summaryrefslogtreecommitdiffstats
path: root/WebKit/chromium/public/WebCommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/chromium/public/WebCommon.h')
-rw-r--r--WebKit/chromium/public/WebCommon.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/WebKit/chromium/public/WebCommon.h b/WebKit/chromium/public/WebCommon.h
index d347ea6..2bfa17d 100644
--- a/WebKit/chromium/public/WebCommon.h
+++ b/WebKit/chromium/public/WebCommon.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -66,7 +66,7 @@
// Exported symbols need to be annotated with WEBKIT_API
#if defined(WIN32) && defined(WEBKIT_DLL)
- #if defined(WEBKIT_IMPLEMENTATION)
+ #if WEBKIT_IMPLEMENTATION
#define WEBKIT_API __declspec(dllexport)
#else
#define WEBKIT_API __declspec(dllimport)
@@ -80,15 +80,40 @@
#include <stddef.h> // For size_t
+#if defined(WIN32)
+// Visual Studio doesn't have stdint.h.
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned int uint32_t;
+#endif
+
namespace WebKit {
- // UTF-16 character type
+// UTF-16 character type
#if defined(WIN32)
typedef wchar_t WebUChar;
#else
typedef unsigned short WebUChar;
#endif
+// -----------------------------------------------------------------------------
+// Assertions
+
+WEBKIT_API void failedAssertion(const char* file, int line, const char* function, const char* assertion);
+
} // namespace WebKit
+// Ideally, only use inside the public directory but outside of WEBKIT_IMPLEMENTATION blocks. (Otherwise use WTF's ASSERT.)
+#if defined(NDEBUG)
+#define WEBKIT_ASSERT(assertion) ((void)0)
+#else
+#define WEBKIT_ASSERT(assertion) do { \
+ if (!(assertion)) \
+ failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \
+} while (0)
+#endif
+
+#define WEBKIT_ASSERT_NOT_REACHED() WEBKIT_ASSERT(0)
+
#endif