00001 #ifndef FILE_COMPILECHECK_HPP
00002 #define FILE_COMPILECHECK_HPP
00003
00004 /* Don't compile on egcs
00005 template <bool B>
00006 struct CompileCheck
00007 {};
00008
00009 struct CompileCheck<true>
00010 {};
00011
00012 struct CompileCheck<false>
00013 {
00014 // not defined
00015 CompileCheck();
00016 };
00017 */
00018
00019 /* this work even in C */
00020 #if defined(__GNUC__) && __GNUC__ >= 2
00021 #define COMPILE_CHECK(name,check) \
00022 extern int name[(check)?1:-1] __attribute__ ((unused))
00023 #else
00024 #define COMPILE_CHECK(name,check) \
00025 extern int name[(check)?1:-1]
00026 #endif
00027
00028 #endif //FILE_COMPILECHECK_HPP
1.2.15