]> granicus.if.org Git - php/commitdiff
fix macro redifinitions
authorAnatol Belski <ab@php.net>
Tue, 11 Jul 2017 08:01:37 +0000 (10:01 +0200)
committerAnatol Belski <ab@php.net>
Tue, 11 Jul 2017 08:01:37 +0000 (10:01 +0200)
ext/sodium/libsodium.c
ext/sodium/php_libsodium.h

index 34bf7d4a2e52370a108f61b33dec0a1677e3ee68..10c23310bd63f9cea259f81455ce6d6041b6fcca 100644 (file)
 #include "php.h"
 #include "php_ini.h"
 #include "ext/standard/info.h"
-#include "php_libsodium.h"
 #include "zend_exceptions.h"
 
 #include <sodium.h>
+#include "php_libsodium.h"
+
 #include <stdint.h>
 
 #define PHP_SODIUM_ZSTR_TRUNCATE(zs, len) do { ZSTR_LEN(zs) = (len); } while(0)
index 93d92e3e036b0db5a19b25ee74f3fbbec2e903c0..a24c3e4fa5c1100dfdf61d2998dded87d497b00d 100644 (file)
@@ -96,9 +96,15 @@ PHP_FUNCTION(sodium_add);
 PHP_FUNCTION(sodium_memcmp);
 PHP_FUNCTION(sodium_memzero);
 
+#ifndef crypto_kx_BYTES
 #define crypto_kx_BYTES crypto_scalarmult_BYTES
+#endif
+#ifndef crypto_kx_PUBLICKEYBYTES
 #define crypto_kx_PUBLICKEYBYTES crypto_scalarmult_SCALARBYTES
+#endif
+#ifndef crypto_kx_SECRETKEYBYTES
 #define crypto_kx_SECRETKEYBYTES crypto_scalarmult_SCALARBYTES
+#endif
 
 #endif /* PHP_LIBSODIUM_H */