mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Detect platforms where memset(0) doesn't set doubles to 0.0.
This is allowed by the C statndard, which permits you to represent doubles any way you like, but in practice we have some code that assumes that memset() clears doubles in structs. Noticed as part of 7802 review; see 8081 for more info.
This commit is contained in:
@@ -74,6 +74,11 @@
|
||||
#error "It seems your platform does not represent NULL as zero. We can't cope."
|
||||
#endif
|
||||
|
||||
#ifndef DOUBLE_0_REP_IS_ZERO_BYTES
|
||||
#error "It seems your platform does not represent 0.0 as zeros. We can't cope."
|
||||
#endif
|
||||
|
||||
|
||||
#if 'a'!=97 || 'z'!=122 || 'A'!=65 || ' '!=32
|
||||
#error "It seems that you encode characters in something other than ASCII."
|
||||
#endif
|
||||
|
||||
@@ -151,6 +151,9 @@
|
||||
/* Define to 1 iff NULL is represented by a 0 in memory. */
|
||||
#define NULL_REP_IS_ZERO_BYTES 1
|
||||
|
||||
/* Define to 1 iff memset(0) sets doubles to 0.0 */
|
||||
#define DOUBLE_0_REP_IS_ZERO_BYTES 1
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "tor"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user