Skip to content

Commit 1330359

Browse files
committed
Fix [-Wundef] warning in MySQLnd extension
1 parent 82afcf4 commit 1330359

7 files changed

+9
-9
lines changed

ext/mysqlnd/mysqlnd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
on production systems, if of course measured performance degradation is not
3737
minimal.
3838
*/
39-
#if A0 && PHP_DEBUG
39+
#if defined(A0) && PHP_DEBUG
4040
#define MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND 1
4141
#endif
4242

ext/mysqlnd/mysqlnd_debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ MYSQLND_METHOD(mysqlnd_debug, log)(MYSQLND_DEBUG * self,
7676
}
7777
if (flags & MYSQLND_DEBUG_DUMP_TIME) {
7878
/* The following from FF's DBUG library, which is in the public domain */
79-
#if defined(PHP_WIN32)
79+
#ifdef PHP_WIN32
8080
/* FIXME This doesn't give microseconds as in Unix case, and the resolution is
8181
in system ticks, 10 ms intervals. See my_getsystime.c for high res */
8282
SYSTEMTIME loc_t;
@@ -173,7 +173,7 @@ MYSQLND_METHOD(mysqlnd_debug, log_va)(MYSQLND_DEBUG *self,
173173
}
174174
if (flags & MYSQLND_DEBUG_DUMP_TIME) {
175175
/* The following from FF's DBUG library, which is in the public domain */
176-
#if defined(PHP_WIN32)
176+
#ifdef PHP_WIN32
177177
/* FIXME This doesn't give microseconds as in Unix case, and the resolution is
178178
in system ticks, 10 ms intervals. See my_getsystime.c for high res */
179179
SYSTEMTIME loc_t;

ext/mysqlnd/mysqlnd_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ PHPAPI void mysqlnd_library_init(void)
8080
mysqlnd_plugin_core.plugin_header.plugin_stats.values = mysqlnd_global_stats;
8181
mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_core);
8282
}
83-
#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1
83+
#if MYSQLND_DBG_ENABLED == 1
8484
mysqlnd_example_plugin_register();
8585
#endif
8686
mysqlnd_debug_trace_plugin_register();

ext/mysqlnd/mysqlnd_plugin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "mysqlnd_debug.h"
2323

2424
/*--------------------------------------------------------------------*/
25-
#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1
25+
#if MYSQLND_DBG_ENABLED == 1
2626
static enum_func_status mysqlnd_example_plugin_end(void * p);
2727

2828
static MYSQLND_STATS * mysqlnd_plugin_example_stats = NULL;
@@ -84,7 +84,7 @@ mysqlnd_example_plugin_register(void)
8484
mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_example_plugin);
8585
}
8686
/* }}} */
87-
#endif /* defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1 */
87+
#endif /* MYSQLND_DBG_ENABLED == 1 */
8888
/*--------------------------------------------------------------------*/
8989

9090
static HashTable mysqlnd_registered_plugins;

ext/mysqlnd/mysqlnd_protocol_frame_codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ MYSQLND_METHOD(mysqlnd_pfc, send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const v
115115
DBG_INF_FMT("writing "MYSQLND_SZ_T_SPEC" bytes to the network", payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE);
116116
bytes_sent = vio->data->m.network_write(vio, compress_buf, payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE, conn_stats, error_info);
117117
pfc->data->compressed_envelope_packet_no++;
118-
#if WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY
118+
#ifdef WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY
119119
if (res == Z_OK) {
120120
size_t decompressed_size = left + MYSQLND_HEADER_SIZE;
121121
zend_uchar * decompressed_data = mnd_malloc(decompressed_size);

ext/mysqlnd/mysqlnd_ps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
12991299
max_allowed_packet_size on the server and resending the data.
13001300
*/
13011301
#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
1302-
#if HAVE_USLEEP && !defined(PHP_WIN32)
1302+
#if defined(HAVE_USLEEP) && !defined(PHP_WIN32)
13031303
usleep(120000);
13041304
#endif
13051305
if ((packet_len = conn->protocol_frame_codec->m.consume_uneaten_data(conn->protocol_frame_codec, COM_STMT_SEND_LONG_DATA))) {

ext/mysqlnd/mysqlnd_wireprotocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_ROW_BUFFER * row_buffer, zval *
15611561
" bytes after end of packet", (p + len) - packet_end - 1);
15621562
DBG_RETURN(FAIL);
15631563
} else {
1564-
#if defined(MYSQLND_STRING_TO_INT_CONVERSION)
1564+
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
15651565
struct st_mysqlnd_perm_bind perm_bind =
15661566
mysqlnd_ps_fetch_functions[fields_metadata[i].type];
15671567
#endif

0 commit comments

Comments
 (0)