Skip to content

Commit e76f9e2

Browse files
authored
Remove DARWIN symbol (php#13346)
When targeting Darwin systems (macOS, etc.), the compiler defines the __APPLE__ symbol, which should be sufficient and a more established detection method practice in these cases.
1 parent aed6528 commit e76f9e2

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed

UPGRADING.INTERNALS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
5858
- Removed checking and linking with obsolete libbind for some functions.
5959
- Symbol HAVE_JSON has been removed (ext/json is always available since PHP
6060
8.0).
61+
- Symbol DARWIN has been removed (use __APPLE__ to target Darwin systems).
6162

6263
c. Windows build system changes
6364
- Added Bison flag '-Wall' when generating lexer files as done in *nix build

Zend/Zend.m4

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,6 @@ fi
227227
228228
AC_C_INLINE
229229
230-
AC_MSG_CHECKING(target system is Darwin)
231-
if echo "$target" | grep "darwin" > /dev/null; then
232-
AC_DEFINE([DARWIN], 1, [Define if the target system is darwin])
233-
AC_MSG_RESULT(yes)
234-
else
235-
AC_MSG_RESULT(no)
236-
fi
237-
238230
dnl Test and set the alignment define for ZEND_MM. This also does the
239231
dnl logarithmic test for ZEND_MM.
240232
AC_MSG_CHECKING(for MM alignment and log values)

Zend/zend_portability.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ char *alloca();
205205
# endif
206206
#endif
207207

208-
#if !ZEND_DEBUG && (defined(HAVE_ALLOCA) || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
208+
#if !ZEND_DEBUG && (defined(HAVE_ALLOCA) || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(__APPLE__)
209209
# define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
210210
# define ALLOCA_FLAG(name) \
211211
bool name;
@@ -305,7 +305,7 @@ char *alloca();
305305
# define ZEND_FASTCALL
306306
#endif
307307

308-
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)
308+
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(__APPLE__) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)
309309
# define HAVE_NORETURN
310310
# define ZEND_NORETURN __attribute__((noreturn))
311311
#elif defined(ZEND_WIN32)
@@ -321,7 +321,7 @@ char *alloca();
321321
# define ZEND_STACK_ALIGNED
322322
#endif
323323

324-
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__))
324+
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(__APPLE__) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__))
325325
# define HAVE_NORETURN_ALIAS
326326
# define HAVE_ATTRIBUTE_WEAK
327327
#endif

ext/standard/dns.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#undef T_UNSPEC
4141
#endif
4242
#ifdef HAVE_ARPA_NAMESER_H
43-
#ifdef DARWIN
43+
#ifdef __APPLE__
4444
# define BIND_8_COMPAT 1
4545
#endif
4646
#include <arpa/nameser.h>

sapi/cli/ps_title.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern char** environ;
5757
#include <machine/vmparam.h> /* for old BSD */
5858
#include <sys/exec.h>
5959
#endif
60-
#if defined(DARWIN)
60+
#if defined(__APPLE__)
6161
#include <crt_externs.h>
6262
#endif
6363

@@ -91,9 +91,9 @@ extern char** environ;
9191
#define PS_USE_PSTAT
9292
#elif defined(HAVE_PS_STRINGS)
9393
#define PS_USE_PS_STRINGS
94-
#elif defined(BSD) && !defined(DARWIN)
94+
#elif defined(BSD) && !defined(__APPLE__)
9595
#define PS_USE_CHANGE_ARGV
96-
#elif defined(__linux__) || defined(_AIX) || defined(__sgi) || (defined(sun) && !defined(BSD)) || defined(ultrix) || defined(__osf__) || defined(DARWIN)
96+
#elif defined(__linux__) || defined(_AIX) || defined(__sgi) || (defined(sun) && !defined(BSD)) || defined(ultrix) || defined(__osf__) || defined(__APPLE__)
9797
#define PS_USE_CLOBBER_ARGV
9898
#elif defined(PHP_WIN32)
9999
#define PS_USE_WIN32
@@ -102,7 +102,7 @@ extern char** environ;
102102
#endif
103103

104104
/* Different systems want the buffer padded differently */
105-
#if defined(_AIX) || defined(__linux__) || defined(DARWIN)
105+
#if defined(_AIX) || defined(__linux__) || defined(__APPLE__)
106106
#define PS_PADDING '\0'
107107
#else
108108
#define PS_PADDING ' '
@@ -235,7 +235,7 @@ char** save_ps_args(int argc, char** argv)
235235
}
236236
new_argv[argc] = NULL;
237237

238-
#if defined(DARWIN)
238+
#if defined(__APPLE__)
239239
/*
240240
* Darwin (and perhaps other NeXT-derived platforms?) has a static
241241
* copy of the argv pointer, which we may fix like so:

0 commit comments

Comments
 (0)