Add #ifndef guards in cef_build.h to avoid conflicts with other projects using Chromium code.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@461 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-01-05 20:16:27 +00:00
parent 2cc21dbb2f
commit 9cc61f448b
1 changed files with 16 additions and 0 deletions

View File

@ -38,11 +38,17 @@
#else // !BUILDING_CEF_SHARED #else // !BUILDING_CEF_SHARED
#if defined(_WIN32) #if defined(_WIN32)
#ifndef OS_WIN
#define OS_WIN 1 #define OS_WIN 1
#endif
#elif defined(__APPLE__) #elif defined(__APPLE__)
#ifndef OS_MACOSX
#define OS_MACOSX 1 #define OS_MACOSX 1
#endif
#elif defined(__linux__) #elif defined(__linux__)
#ifndef OS_LINUX
#define OS_LINUX 1 #define OS_LINUX 1
#endif
#else #else
#error Please add support for your platform in cef_build.h #error Please add support for your platform in cef_build.h
#endif #endif
@ -50,14 +56,20 @@
// For access to standard POSIXish features, use OS_POSIX instead of a // For access to standard POSIXish features, use OS_POSIX instead of a
// more specific macro. // more specific macro.
#if defined(OS_MACOSX) || defined(OS_LINUX) #if defined(OS_MACOSX) || defined(OS_LINUX)
#ifndef OS_POSIX
#define OS_POSIX 1 #define OS_POSIX 1
#endif #endif
#endif
// Compiler detection. // Compiler detection.
#if defined(__GNUC__) #if defined(__GNUC__)
#ifndef COMPILER_GCC
#define COMPILER_GCC 1 #define COMPILER_GCC 1
#endif
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#ifndef COMPILER_MSVC
#define COMPILER_MSVC 1 #define COMPILER_MSVC 1
#endif
#else #else
#error Please add support for your compiler in cef_build.h #error Please add support for your compiler in cef_build.h
#endif #endif
@ -66,6 +78,7 @@
// method in the parent class. // method in the parent class.
// Use like: // Use like:
// virtual void foo() OVERRIDE; // virtual void foo() OVERRIDE;
#ifndef OVERRIDE
#if defined(COMPILER_MSVC) #if defined(COMPILER_MSVC)
#define OVERRIDE override #define OVERRIDE override
#elif defined(__clang__) #elif defined(__clang__)
@ -73,7 +86,9 @@
#else #else
#define OVERRIDE #define OVERRIDE
#endif #endif
#endif
#ifndef ALLOW_THIS_IN_INITIALIZER_LIST
#if defined(COMPILER_MSVC) #if defined(COMPILER_MSVC)
// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled. // MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled.
@ -106,6 +121,7 @@
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code #define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
#endif // !COMPILER_MSVC #endif // !COMPILER_MSVC
#endif
#endif // !BUILDING_CEF_SHARED #endif // !BUILDING_CEF_SHARED