REORG: compat: move some integer limit definitions from standard.h to compat.h
Historically standard.h was the location where we used to (re-)define the standard set of macros and functions, and to complement the ones missing on the target OS. Over time it has become a toolbox in itself relying on many other things, and its definition of LONGBITS is used everywhere else (e.g. for MAX_THREADS), resulting in painful circular dependencies. Let's move these few defines (integer sizes) to compat.h where other similar definitions normally are.
This commit is contained in:
parent
a9f9fc9e5b
commit
e3e2b7283f
|
@ -31,6 +31,20 @@
|
|||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
// Redefine some limits that are not present everywhere
|
||||
#ifndef LLONG_MAX
|
||||
# define LLONG_MAX 9223372036854775807LL
|
||||
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
#endif
|
||||
|
||||
#ifndef ULLONG_MAX
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
|
||||
#endif
|
||||
|
||||
#ifndef LONGBITS
|
||||
#define LONGBITS ((unsigned int)sizeof(long) * 8)
|
||||
#endif
|
||||
|
||||
#ifndef BITS_PER_INT
|
||||
#define BITS_PER_INT (8*sizeof(int))
|
||||
#endif
|
||||
|
|
|
@ -40,19 +40,6 @@
|
|||
#include <eb32sctree.h>
|
||||
#include <types/protocol.h>
|
||||
|
||||
#ifndef LLONG_MAX
|
||||
# define LLONG_MAX 9223372036854775807LL
|
||||
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
#endif
|
||||
|
||||
#ifndef ULLONG_MAX
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
|
||||
#endif
|
||||
|
||||
#ifndef LONGBITS
|
||||
#define LONGBITS ((unsigned int)sizeof(long) * 8)
|
||||
#endif
|
||||
|
||||
/* size used for max length of decimal representation of long long int. */
|
||||
#define NB_LLMAX_STR (sizeof("-9223372036854775807")-1)
|
||||
|
||||
|
|
Loading…
Reference in New Issue