Skip to content

Commit cbbf579

Browse files
committed
fix macro redifinitions
1 parent 8cfe479 commit cbbf579

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ext/sodium/libsodium.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
#include "php.h"
2424
#include "php_ini.h"
2525
#include "ext/standard/info.h"
26-
#include "php_libsodium.h"
2726
#include "zend_exceptions.h"
2827

2928
#include <sodium.h>
29+
#include "php_libsodium.h"
30+
3031
#include <stdint.h>
3132

3233
#define PHP_SODIUM_ZSTR_TRUNCATE(zs, len) do { ZSTR_LEN(zs) = (len); } while(0)

ext/sodium/php_libsodium.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,15 @@ PHP_FUNCTION(sodium_add);
9696
PHP_FUNCTION(sodium_memcmp);
9797
PHP_FUNCTION(sodium_memzero);
9898

99+
#ifndef crypto_kx_BYTES
99100
#define crypto_kx_BYTES crypto_scalarmult_BYTES
101+
#endif
102+
#ifndef crypto_kx_PUBLICKEYBYTES
100103
#define crypto_kx_PUBLICKEYBYTES crypto_scalarmult_SCALARBYTES
104+
#endif
105+
#ifndef crypto_kx_SECRETKEYBYTES
101106
#define crypto_kx_SECRETKEYBYTES crypto_scalarmult_SCALARBYTES
107+
#endif
102108

103109
#endif /* PHP_LIBSODIUM_H */
104110

0 commit comments

Comments
 (0)