]> mj.ucw.cz Git - libucw.git/blob - ucw/config.h
Merge remote-tracking branch 'origin/dev-table' into dev-table
[libucw.git] / ucw / config.h
1 /*
2  *      UCW Library -- Configuration-Dependent Definitions
3  *
4  *      (c) 1997--2012 Martin Mares <mj@ucw.cz>
5  *      (c) 2006 Robert Spalek <robert@ucw.cz>
6  *
7  *      This software may be freely distributed and used according to the terms
8  *      of the GNU Lesser General Public License.
9  */
10
11 #ifndef _UCW_CONFIG_H
12 #define _UCW_CONFIG_H
13
14 /* Configuration switches */
15
16 #include "autoconf.h"
17
18 /* Tell libc we're going to use all extensions available */
19
20 #ifndef _GNU_SOURCE
21 #define _GNU_SOURCE
22 #endif
23
24 /* Types (based on standard C99 integers) */
25
26 #include <stddef.h>
27 #include <stdint.h>
28
29 typedef uint8_t byte;                   /** Exactly 8 bits, unsigned **/
30 typedef uint8_t u8;                     /** Exactly 8 bits, unsigned **/
31 typedef int8_t s8;                      /** Exactly 8 bits, signed **/
32 typedef uint16_t u16;                   /** Exactly 16 bits, unsigned **/
33 typedef int16_t s16;                    /** Exactly 16 bits, signed **/
34 typedef uint32_t u32;                   /** Exactly 32 bits, unsigned **/
35 typedef int32_t s32;                    /** Exactly 32 bits, signed **/
36 typedef uint64_t u64;                   /** Exactly 64 bits, unsigned **/
37 typedef int64_t s64;                    /** Exactly 64 bits, signed **/
38
39 typedef unsigned int uint;              /** A better pronounceable alias for `unsigned int` **/
40 typedef s64 timestamp_t;                /** Milliseconds since an unknown epoch **/
41
42 // FIXME: This should be removed soon
43 typedef uint uns;                       /** Backwards compatible alias for `uint' ***/
44
45 #ifdef CONFIG_UCW_LARGE_FILES
46 typedef s64 ucw_off_t;                  /** File position (either 32- or 64-bit, depending on `CONFIG_UCW_LARGE_FILES`). **/
47 #else
48 typedef s32 ucw_off_t;
49 #endif
50
51 #endif