summaryrefslogtreecommitdiffstats
path: root/build/build_config.h
diff options
context:
space:
mode:
authordeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-05 11:56:30 +0000
committerdeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-05 11:56:30 +0000
commitab8c0b042557b4f3153652f1de7472738ced05c7 (patch)
treeecf1af91344dbba4aa33c7ba1033cf4d40705160 /build/build_config.h
parent611dbe053ab473cda35e1618e0907cc40f328f6c (diff)
downloadchromium_src-ab8c0b042557b4f3153652f1de7472738ced05c7.zip
chromium_src-ab8c0b042557b4f3153652f1de7472738ced05c7.tar.gz
chromium_src-ab8c0b042557b4f3153652f1de7472738ced05c7.tar.bz2
Add process information (ARCH_CPU_*) to build_config.h.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/build_config.h')
-rw-r--r--build/build_config.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/build/build_config.h b/build/build_config.h
index 23e90c8..87dd259 100644
--- a/build/build_config.h
+++ b/build/build_config.h
@@ -27,6 +27,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// This file adds defines about the platform we're currently building on.
+// Operating System:
+// OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX)
+// Compiler:
+// COMPILER_MSVC / COMPILER_GCC
+// Processor:
+// ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
+// ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
+
#ifndef BUILD_BUILD_CONFIG_H_
#define BUILD_BUILD_CONFIG_H_
@@ -49,9 +58,26 @@
// Compiler detection.
#if defined(__GNUC__)
-#define COMPILER_GCC
+#define COMPILER_GCC 1
#elif defined(_MSC_VER)
-#define COMPILER_MSVC
+#define COMPILER_MSVC 1
+#else
+#error Please add support for your compiler in build/build_config.h
+#endif
+
+// Processor architecture detection. For more info on what's defined, see:
+// http://msdn.microsoft.com/en-us/library/b0084kay.aspx
+// http://www.agner.org/optimize/calling_conventions.pdf
+#if defined(_M_X64) || defined(__x86_64__)
+#define ARCH_CPU_X86_FAMILY 1
+#define ARCH_CPU_X86_64 1
+#define ARCH_CPU_64_BITS 1
+#elif defined(_M_IX86) || defined(__i386__)
+#define ARCH_CPU_X86_FAMILY 1
+#define ARCH_CPU_X86 1
+#define ARCH_CPU_32_BITS 1
+#else
+#error Please add support for your architecture in build/build_config.h
#endif
#endif // BUILD_BUILD_CONFIG_H_