From f9959ee7c2004919675d9cdc7c82f886f099f15f Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Wed, 22 Feb 2017 12:31:06 +0100 Subject: 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 --- main/php.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'main/php.h') 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 -- cgit v1.2.1