summaryrefslogtreecommitdiffstats
path: root/73.patch
blob: f7e9e425c0f9628ceadf00defbe7a8d1f10aa7d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From a012b849d0a382c7f4ef3c1249f2ec6aec0ff7a9 Mon Sep 17 00:00:00 2001
From: Tyson Andre <tysonandre775@hotmail.com>
Date: Wed, 12 Jul 2017 08:45:54 -0700
Subject: [PATCH] Stop creating inaccessible global constants "0" and "1"

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]`)
---
 mosquitto.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mosquitto.c b/mosquitto.c
index d1e105f..7341728 100644
--- a/mosquitto.c
+++ b/mosquitto.c
@@ -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();