diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-01-22 09:37:31 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-22 21:05:30 +0000 |
commit | 8f1bbcf83e23286ebdfd17b83d886fc8f0a3eb2a (patch) | |
tree | 8b73a35a6104159f5055f1e0b42a63004758bc8f /toxcore/DHT.c | |
parent | e6c04ef0287a69c453f129778ef35932e0dff4b2 (diff) |
Use <stdlib.h> for alloca on FreeBSD.
https://www.freebsd.org/cgi/man.cgi?alloca
If stdlib.h does not define alloca, and we're using GCC (or Clang), we
define the macro ourselves in terms of a GCC builtin.
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r-- | toxcore/DHT.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 33ebc690..747f7328 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -535,7 +535,7 @@ int pack_nodes(uint8_t *data, uint16_t length, const Node_format *nodes, uint16_ | |||
535 | memcpy(data + packed_length, nodes[i].public_key, CRYPTO_PUBLIC_KEY_SIZE); | 535 | memcpy(data + packed_length, nodes[i].public_key, CRYPTO_PUBLIC_KEY_SIZE); |
536 | packed_length += CRYPTO_PUBLIC_KEY_SIZE; | 536 | packed_length += CRYPTO_PUBLIC_KEY_SIZE; |
537 | 537 | ||
538 | uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; | 538 | const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; |
539 | assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); | 539 | assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); |
540 | } | 540 | } |
541 | 541 | ||
@@ -571,7 +571,7 @@ int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed | |||
571 | len_processed += CRYPTO_PUBLIC_KEY_SIZE; | 571 | len_processed += CRYPTO_PUBLIC_KEY_SIZE; |
572 | ++num; | 572 | ++num; |
573 | 573 | ||
574 | uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; | 574 | const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; |
575 | assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); | 575 | assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); |
576 | } | 576 | } |
577 | 577 | ||