Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1871)

Unified Diff: nss/lib/util/secport.h

Issue 1504923011: Update NSS to 3.21 RTM and NSPR to 4.11 RTM (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: nss/lib/util/secport.h
diff --git a/nss/lib/util/secport.h b/nss/lib/util/secport.h
index f01eb74c7b2db00757f8eaf439d6f0a808af5178..95c73c8d5a1e3e11d83c197e1b5ca5a420bc6cda 100644
--- a/nss/lib/util/secport.h
+++ b/nss/lib/util/secport.h
@@ -87,6 +87,19 @@ extern char *PORT_ArenaStrdup(PLArenaPool *arena, const char *str);
SEC_END_PROTOS
#define PORT_Assert PR_ASSERT
+/* This runs a function that should return SECSuccess.
+ * Intended for NSS internal use only.
+ * The return value is asserted in a debug build, otherwise it is ignored.
+ * This is no substitute for proper error handling. It is OK only if you
+ * have ensured that the function cannot fail by other means such as checking
+ * prerequisites. In that case this can be used as a safeguard against
+ * unexpected changes in a function.
+ */
+#ifdef DEBUG
+#define PORT_CheckSuccess(f) PR_ASSERT((f) == SECSuccess)
+#else
+#define PORT_CheckSuccess(f) (f)
+#endif
#define PORT_ZNew(type) (type*)PORT_ZAlloc(sizeof(type))
#define PORT_New(type) (type*)PORT_Alloc(sizeof(type))
#define PORT_ArenaNew(poolp, type) \
« nss/lib/util/pkcs11n.h ('K') | « nss/lib/util/secoidt.h ('k') | nss/lib/util/secport.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698