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

Unified Diff: build/build_config.h

Issue 12944002: Attempt at improved OS macros (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/build_config.h
diff --git a/build/build_config.h b/build/build_config.h
index 462518d26d6d5988ad6533e864c5674c8de31cad..fccd8da90cb2f2e677a242daf59896e236975092 100644
--- a/build/build_config.h
+++ b/build/build_config.h
@@ -21,15 +21,20 @@
// A set of macros to use for platform detection.
#if defined(__APPLE__)
#define OS_MACOSX 1
+#define OS_IS_ENABLED__WIN +
Ryan Sleevi 2013/03/19 21:55:13 BUG: s/__WIN/__MAC
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#define OS_IOS 1
+#define OS_IS_ENABLED__IOS +
#endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#elif defined(ANDROID)
#define OS_ANDROID 1
+#define OS_IS_ENABLED__ANDROID +
#elif defined(__native_client__)
#define OS_NACL 1
+#define OS_IS_ENABLED__NACL +
#elif defined(__linux__)
#define OS_LINUX 1
+#define OS_IS_ENABLED__LINUX +
// Use TOOLKIT_GTK on linux if TOOLKIT_VIEWS isn't defined.
#if !defined(TOOLKIT_VIEWS)
#define TOOLKIT_GTK
@@ -37,19 +42,25 @@
#elif defined(_WIN32)
#define OS_WIN 1
#define TOOLKIT_VIEWS 1
+#define OS_IS_ENABLED__WIN +
#elif defined(__FreeBSD__)
#define OS_FREEBSD 1
+#define OS_IS_ENABLED__FREEBSD +
#define TOOLKIT_GTK
#elif defined(__OpenBSD__)
#define OS_OPENBSD 1
+#define OS_IS_ENABLED__OPENBSD +
#define TOOLKIT_GTK
#elif defined(__sun)
#define OS_SOLARIS 1
+#define OS_IS_ENABLED__SOLARIS +
#define TOOLKIT_GTK
#else
#error Please add support for your platform in build/build_config.h
#endif
+#define OS(x) ((1 OS_IS_ENABLED__##x 1) == 2)
+
#if defined(USE_OPENSSL) && defined(USE_NSS)
#error Cannot use both OpenSSL and NSS
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698