summaryrefslogtreecommitdiff
path: root/cesar/lib/defs.h
blob: 4b9401086be80c54db5e9cfa43816a6daa1bd8de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef lib_defs_h
#define lib_defs_h
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    lib/defs.h
 * \brief   Globals compiler and target specific defines.
 * \ingroup lib
 */

/** Defined to 1 if the target is using big endian. */
#define DEFS_BIG_ENDIAN _see_below_
#undef DEFS_BIG_ENDIAN

/** Defined to 1 if structure's bit fields should be reversed. */
#define DEFS_REVERSE_BITFIELDS _see_below_
#undef DEFS_REVERSE_BITFIELDS

#if defined (__sparc__)

#  define DEFS_BIG_ENDIAN 1
#  define DEFS_REVERSE_BITFIELDS 1

#else /* others. */

#  define DEFS_BIG_ENDIAN 0
#  define DEFS_REVERSE_BITFIELDS 0

#endif

/** Declare a name as private.  It will define a static symbol unless
 * NO_PRIVATE is defined. */
#ifndef NO_PRIVATE
#  define PRIVATE static
#else
#  define PRIVATE
#endif

#if __GNUC__ < 4
/* This attribute is not defined for older GCC versions. */
#  define warn_unused_result
#endif

#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) \
     && defined (__NO_INLINE__))
/* We really really want inlining.  GCC 4.4 will not inline if optimization is
 * disable. */
#  define inline inline __attribute__ ((always_inline))
#endif

#endif /* lib_defs_h */