com php-src: fix macro redifinitions: ext/sodium/libsodium.c ext/sodium/php_libsodium.h
| From: | Anatol Belski | Date: | Tue, 11 Jul 2017 08:01:37 +0000 |
| Subject: | com php-src: fix macro redifinitions: ext/sodium/libsodium.c ext/sodium/php_libsodium.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98510@lists.php.net to get a copy of this message | ||
Commit: cbbf579f2178073b4d88c0bd2f2052e853a32a1e
Author: Anatol Belski <ab@php.net> Tue, 11 Jul 2017 10:01:37 +0200
Parents: 8cfe479d1f95fd09030892529918d8d68f23c43b
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cbbf579f2178073b4d88c0bd2f2052e853a32a1e
Log:
fix macro redifinitions
Changed paths:
M ext/sodium/libsodium.c
M ext/sodium/php_libsodium.h
Diff:
diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c
index 34bf7d4..10c2331 100644
--- a/ext/sodium/libsodium.c
+++ b/ext/sodium/libsodium.c
@@ -23,10 +23,11 @@
#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)
diff --git a/ext/sodium/php_libsodium.h b/ext/sodium/php_libsodium.h
index 93d92e3..a24c3e4 100644
--- a/ext/sodium/php_libsodium.h
+++ b/ext/sodium/php_libsodium.h
@@ -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 */