about summary refs log tree commit diff
path: root/src/base/detect.h
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-14 17:19:13 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-14 17:19:13 +0000
commit817f431377c7f1545621ff597c018b133651e991 (patch)
tree03fe513c4cc7d34ce9537f81375251ba86b33950 /src/base/detect.h
parent0fceb1cf1ab9887040f08f0abf646ef318a65ae3 (diff)
downloadzcatch-817f431377c7f1545621ff597c018b133651e991.tar.gz
zcatch-817f431377c7f1545621ff597c018b133651e991.zip
moved out e_system, e_detect, vmath and math to a little base library
Diffstat (limited to 'src/base/detect.h')
-rw-r--r--src/base/detect.h115
1 files changed, 115 insertions, 0 deletions
diff --git a/src/base/detect.h b/src/base/detect.h
new file mode 100644
index 00000000..04cca2d9
--- /dev/null
+++ b/src/base/detect.h
@@ -0,0 +1,115 @@
+/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
+#ifndef BASELIB_FILE_CONFIG_H
+#define BASELIB_FILE_CONFIG_H
+
+/*
+  this file detected the family, platform and architecture
+  to compile for.
+*/
+
+/* platforms */
+
+/* windows Family */
+#if defined(WIN64) || defined(_WIN64)
+	/* Hmm, is this IA64 or x86-64? */
+	#define CONF_FAMILY_WINDOWS 1
+	#define CONF_FAMILY_STRING "windows"
+	#define CONF_PLATFORM_WIN64 1
+	#define CONF_PLATFORM_STRING "win64"
+#elif defined(WIN32) || defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__)
+	#define CONF_FAMILY_WINDOWS 1
+	#define CONF_FAMILY_STRING "windows"
+	#define CONF_PLATFORM_WIN32 1
+	#define CONF_PLATFORM_STRING "win32"
+#endif
+
+/* unix family */
+#if defined(__FreeBSD__)
+	#define CONF_FAMILY_UNIX 1
+	#define CONF_FAMILY_STRING "unix"
+	#define CONF_PLATFORM_FREEBSD 1
+	#define CONF_PLATFORM_STRING "freebsd"
+#endif
+
+#if defined(__OpenBSD__)
+	#define CONF_FAMILY_UNIX 1
+	#define CONF_FAMILY_STRING "unix"
+	#define CONF_PLATFORM_OPENBSD 1
+	#define CONF_PLATFORM_STRING "openbsd"
+#endif
+
+#if defined(__LINUX__) || defined(__linux__)
+	#define CONF_FAMILY_UNIX 1
+	#define CONF_FAMILY_STRING "unix"
+	#define CONF_PLATFORM_LINUX 1
+	#define CONF_PLATFORM_STRING "linux"
+#endif
+
+#if defined(MACOSX) || defined(__APPLE__) || defined(__DARWIN__)
+	#define CONF_FAMILY_UNIX 1
+	#define CONF_FAMILY_STRING "unix"
+	#define CONF_PLATFORM_MACOSX 1
+	#define CONF_PLATFORM_STRING "macosx"
+#endif
+
+#if defined(__sun)
+	#define CONF_FAMILY_UNIX 1
+	#define CONF_FAMILY_STRING "unix"
+	#define CONF_PLATFROM_SOLARIS 1
+	#define CONF_PLATFORM_STRING "solaris"
+#endif
+
+/* beos family */
+#if defined(__BeOS) || defined(__BEOS__)
+	#define CONF_FAMILY_BEOS 1
+	#define CONF_FAMILY_STRING "beos"
+	#define CONF_PLATFORM_BEOS 1
+	#define CONF_PLATFORM_STRING "beos"
+#endif
+
+
+/* architectures */
+#if defined(i386) || defined(__i386__) || defined(__x86__) || defined(CONF_PLATFORM_WIN32)
+	#define CONF_ARCH_IA32 1
+	#define CONF_ARCH_STRING "ia32"
+	#define CONF_ARCH_ENDIAN_LITTLE 1
+#endif
+
+#if defined(__ia64__)
+	#define CONF_ARCH_IA64 1
+	#define CONF_ARCH_STRING "ia64"
+	#define CONF_ARCH_ENDIAN_LITTLE 1
+#endif
+
+#if defined(__amd64__) || defined(__x86_64__)
+	#define CONF_ARCH_AMD64 1
+	#define CONF_ARCH_STRING "amd64"
+	#define CONF_ARCH_ENDIAN_LITTLE 1
+#endif
+
+#if defined(__powerpc__) || defined(__ppc__)
+	#define CONF_ARCH_PPC 1
+	#define CONF_ARCH_STRING "ppc"
+	#define CONF_ARCH_ENDIAN_BIG 1
+#endif
+
+#if defined(__sparc__)
+	#define CONF_ARCH_SPARC 1
+	#define CONF_ARCH_STRING "sparc"
+	#define CONF_ARCH_ENDIAN_BIG 1
+#endif
+
+
+#ifndef CONF_FAMILY_STRING
+#define CONF_FAMILY_STRING "unknown"
+#endif
+
+#ifndef CONF_PLATFORM_STRING
+#define CONF_PLATFORM_STRING "unknown"
+#endif
+
+#ifndef CONF_ARCH_STRING
+#define CONF_ARCH_STRING "unknown"
+#endif
+
+#endif