Skip to content

Sync #if/ifdef/defined #14371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ext/date/php_date.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,20 +1302,20 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, bool gmt)
ta.tm_yday = timelib_day_of_year(ts->y, ts->m, ts->d);
if (gmt) {
ta.tm_isdst = 0;
#if HAVE_STRUCT_TM_TM_GMTOFF
#ifdef HAVE_STRUCT_TM_TM_GMTOFF
ta.tm_gmtoff = 0;
#endif
#if HAVE_STRUCT_TM_TM_ZONE
#ifdef HAVE_STRUCT_TM_TM_ZONE
ta.tm_zone = "GMT";
#endif
} else {
offset = timelib_get_time_zone_info(timestamp, tzi);

ta.tm_isdst = offset->is_dst;
#if HAVE_STRUCT_TM_TM_GMTOFF
#ifdef HAVE_STRUCT_TM_TM_GMTOFF
ta.tm_gmtoff = offset->offset;
#endif
#if HAVE_STRUCT_TM_TM_ZONE
#ifdef HAVE_STRUCT_TM_TM_ZONE
ta.tm_zone = offset->abbr;
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/iconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

#ifdef PHP_ICONV_IMPL
#define PHP_ICONV_IMPL_VALUE PHP_ICONV_IMPL
#elif HAVE_LIBICONV
#elif defined(HAVE_LIBICONV)
#define PHP_ICONV_IMPL_VALUE "libiconv"
#else
#define PHP_ICONV_IMPL_VALUE "unknown"
Expand Down
4 changes: 2 additions & 2 deletions ext/random/csprng.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# endif
#endif

#if HAVE_COMMONCRYPTO_COMMONRANDOM_H
#ifdef HAVE_COMMONCRYPTO_COMMONRANDOM_H
# include <CommonCrypto/CommonCryptoError.h>
# include <CommonCrypto/CommonRandom.h>
#endif
Expand All @@ -71,7 +71,7 @@ PHPAPI zend_result php_random_bytes(void *bytes, size_t size, bool should_throw)
}
return FAILURE;
}
#elif HAVE_COMMONCRYPTO_COMMONRANDOM_H
#elif defined(HAVE_COMMONCRYPTO_COMMONRANDOM_H)
/*
* Purposely prioritized upon arc4random_buf for modern macOs releases
* arc4random api on this platform uses `ccrng_generate` which returns
Expand Down
2 changes: 1 addition & 1 deletion ext/sockets/conversions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context

str = zval_get_tmp_string((zval *) zv, &tmp_str);

#if HAVE_IF_NAMETOINDEX
#ifdef HAVE_IF_NAMETOINDEX
ret = if_nametoindex(ZSTR_VAL(str));
if (ret == 0) {
do_from_zval_err(ctx, "no interface with name \"%s\" could be found", ZSTR_VAL(str));
Expand Down
2 changes: 1 addition & 1 deletion ext/sockets/multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int _php_source_op_to_ipv4_op(enum source_op sop);

zend_result php_string_to_if_index(const char *val, unsigned *out)
{
#if HAVE_IF_NAMETOINDEX
#ifdef HAVE_IF_NAMETOINDEX
unsigned int ind;

ind = if_nametoindex(val);
Expand Down
2 changes: 1 addition & 1 deletion ext/sockets/php_sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# include "config.h"
#endif

#if HAVE_SOCKETS
#ifdef HAVE_SOCKETS

#include <php.h>
#ifdef PHP_WIN32
Expand Down
2 changes: 1 addition & 1 deletion ext/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# include <sys/uio.h>
# define set_errno(a) (errno = a)
# include "php_sockets.h"
# if HAVE_IF_NAMETOINDEX
# ifdef HAVE_IF_NAMETOINDEX
# include <net/if.h>
# endif
# if defined(HAVE_LINUX_SOCK_DIAG_H)
Expand Down
4 changes: 2 additions & 2 deletions main/streams/cast.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static int stream_cookie_closer(void *cookie)
}
#endif /* elif defined(HAVE_FOPENCOOKIE) */

#if HAVE_FOPENCOOKIE
#ifdef HAVE_FOPENCOOKIE
static cookie_io_functions_t stream_cookie_functions =
{
stream_cookie_reader, stream_cookie_writer,
Expand Down Expand Up @@ -220,7 +220,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
goto exit_success;
}

#if HAVE_FOPENCOOKIE
#ifdef HAVE_FOPENCOOKIE
/* if just checking, say yes we can be a FILE*, but don't actually create it yet */
if (ret == NULL) {
goto exit_success;
Expand Down
2 changes: 1 addition & 1 deletion main/streams/userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ static int statbuf_from_array(zval *array, php_stream_statbuf *ssb)
STAT_PROP_ENTRY(nlink);
STAT_PROP_ENTRY(uid);
STAT_PROP_ENTRY(gid);
#if HAVE_STRUCT_STAT_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
STAT_PROP_ENTRY(rdev);
#endif
STAT_PROP_ENTRY(size);
Expand Down
2 changes: 1 addition & 1 deletion sapi/fuzzer/fuzzer-exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "fuzzer-sapi.h"

int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
#if HAVE_EXIF
#ifdef HAVE_EXIF
php_stream *stream;
zval stream_zv;

Expand Down
Loading