Commit bb21450f authored by Vladimír Čunát's avatar Vladimír Čunát

uint: typedef globally but not more than once

Before C11, repeating a typedef is forbidden, if taken strictly, and
some compiler versions even reject it.  On the other hand lru.h was
missing it, which wasn't noticed due to glibc's <sys/types.h> defining it.
Fixes https://gitlab.labs.nic.cz/knot/resolver/issues/114.
parent 890be5e0
......@@ -38,7 +38,12 @@ typedef int32_t s32; /** Exactly 32 bits, signed **/
typedef uint64_t u64; /** Exactly 64 bits, unsigned **/
typedef int64_t s64; /** Exactly 64 bits, signed **/
#ifndef uint /* Redefining typedef is a C11 feature. */
typedef unsigned int uint; /** A better pronounceable alias for `unsigned int` **/
#define uint uint
#endif
typedef s64 timestamp_t; /** Milliseconds since an unknown epoch **/
// FIXME: This should be removed soon
......
......@@ -36,6 +36,11 @@
#define KR_COLD
#endif
#ifndef uint /* Redefining typedef is a C11 feature. */
typedef unsigned int uint;
#define uint uint
#endif
/*
* Error codes.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment