Skip to content

Commit

Permalink
Stop creating inaccessible global constants "0" and "1"
Browse files Browse the repository at this point in the history
This was a side effect of the macro that was used to declare constants
for the values of the stringified version of the constant name.

`get_defined_constants(true)['mosquitto']` can be used to show the old
constants (`["MOSQ_LOG_INFO"] => 1, ..., "0" => 0, "1" => 1]`)
  • Loading branch information
TysonAndre committed Jul 12, 2017
1 parent e490f51 commit a012b84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mosquitto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,9 +1451,9 @@ PHP_MINIT_FUNCTION(mosquitto)
REGISTER_MOSQUITTO_LONG_CONST("LOG_WARNING", MOSQ_LOG_WARNING);
REGISTER_MOSQUITTO_LONG_CONST("LOG_ERR", MOSQ_LOG_ERR);
REGISTER_MOSQUITTO_LONG_CONST("LOG_DEBUG", MOSQ_LOG_DEBUG);
REGISTER_MOSQUITTO_LONG_CONST("SSL_VERIFY_NONE", 0);
REGISTER_MOSQUITTO_LONG_CONST("SSL_VERIFY_PEER", 1);

zend_declare_class_constant_long(mosquitto_ce_client, "SSL_VERIFY_NONE", sizeof("SSL_VERIFY_NONE")-1, 0 TSRMLS_CC);
zend_declare_class_constant_long(mosquitto_ce_client, "SSL_VERIFY_PEER", sizeof("SSL_VERIFY_PEER")-1, 1 TSRMLS_CC);

mosquitto_lib_init();

Expand Down

0 comments on commit a012b84

Please sign in to comment.