summaryrefslogtreecommitdiff
path: root/main/php.h
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2017-02-22 12:31:06 +0100
committerKalle Sommer Nielsen <kalle@php.net>2017-02-22 12:31:06 +0100
commitf9959ee7c2004919675d9cdc7c82f886f099f15f (patch)
treef23eafdb606c1e8f4b3c89283c9c1a824c480658 /main/php.h
parentdbdb0819b24997ca70fe5609489a6bf828f1feba (diff)
downloadphp-git-f9959ee7c2004919675d9cdc7c82f886f099f15f.tar.gz
Change PHP_OS_FAMILY slightly
* PHP_OS_FAMILY is now a macro, to allow extensions to take advantage of it, it is defined in php.h * Values are not upper-case-first, not always uppercase. Windows is no longer just "Win", if we want the short version for testing then PHP_OS is always WINNT anyway
Diffstat (limited to 'main/php.h')
-rw-r--r--main/php.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/php.h b/main/php.h
index 23d365d9e3..fcf7b8cef5 100644
--- a/main/php.h
+++ b/main/php.h
@@ -41,6 +41,19 @@
#undef sprintf
#define sprintf php_sprintf
+/* Operating system family defintion */
+#ifdef PHP_WIN32
+# define PHP_OS_FAMILY "Windows"
+#elif defined(BSD) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+# define PHP_OS_FAMILY "BSD"
+#elif defined(__APPLE__) || defined(__MACH__)
+# define PHP_OS_FAMILY "OSX"
+#elif defined(__sun__)
+# define PHP_OS_FAMILY "Solaris"
+#elif defined(__linux__)
+# define PHP_OS_FAMILY "Unknown"
+#endif
+
/* PHP's DEBUG value must match Zend's ZEND_DEBUG value */
#undef PHP_DEBUG
#define PHP_DEBUG ZEND_DEBUG