source: Daodan/src/beaengine/macros.h@ 986

Last change on this file since 986 was 984, checked in by alloc, 11 years ago

Daodan: TV code

File size: 1.8 KB
Line 
1#ifndef __BEAENGINE_MACROS_H__
2#define __BEAENGINE_MACROS_H__
3/*
4============================================================================
5 Compiler Silencing macros
6
7 Some compilers complain about parameters that are not used. This macro
8 should keep them quiet.
9 ============================================================================
10 */
11
12# if defined (__GNUC__) && ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)))
13# define BEA_UNUSED_ARG(a) (void) (a)
14#elif defined (ghs) || defined (__GNUC__) || defined (__hpux) || defined (__sgi) || defined (__DECCXX) || defined (__rational__) || defined (__USLC__) || defined (BEA__RM544) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) || defined(__BORLANDC__)
15/*
16 Some compilers complain about "statement with no effect" with (a).
17 This eliminates the warnings, and no code is generated for the null
18 conditional statement. Note, that may only be true if -O is enabled,
19 such as with GreenHills (ghs) 1.8.8.
20 */
21
22# define BEA_UNUSED_ARG(a) do {/* null */} while (&a == 0)
23#elif defined (__DMC__)
24 #if defined(__cplusplus)
25 #define BEA_UNUSED_ID(identifier)
26 template <class T>
27 inline void BEA_UNUSED_ARG(const T& BEA_UNUSED_ID(t)) { }
28 #else
29 #define BEA_UNUSED_ARG(a)
30 #endif
31#else /* ghs || __GNUC__ || ..... */
32# define BEA_UNUSED_ARG(a) (a)
33#endif /* ghs || __GNUC__ || ..... */
34
35#if defined (_MSC_VER) || defined(__sgi) || defined (ghs) || defined (__DECCXX) || defined(__BORLANDC__) || defined (BEA_RM544) || defined (__USLC__) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) || (defined (__HP_aCC) && (__HP_aCC >= 60500))
36# define BEA_NOTREACHED(a)
37#else /* __sgi || ghs || ..... */
38# define BEA_NOTREACHED(a) a
39#endif /* __sgi || ghs || ..... */
40
41#endif /* __BEAENGINE_MACROS_H__ */
Note: See TracBrowser for help on using the repository browser.