diff options
-rw-r--r-- | rules/CC/auto/RULES | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/rules/CC/auto/RULES b/rules/CC/auto/RULES index 7d27ff62..e04289c7 100644 --- a/rules/CC/auto/RULES +++ b/rules/CC/auto/RULES @@ -97,7 +97,8 @@ , "pairs. The first element of each pair is the define name and the" , "second argument is another pair. This pair's first value is the C" , "symbol to search for and the second value is a list with the header" - , "file names to consider for searching." + , "file names to consider for searching. If the header file defines the" + , "symbol as a macro it is considered available and assumed to work." ] , "have_cxxsymbol": [ "Set a define to \"1\" if the specified C++ symbol is defined by one of" @@ -105,7 +106,8 @@ , "pairs. The first element of each pair is the define name and the" , "second argument is another pair. This pair's first value is the C++" , "symbol to search for and the second value is a list with the header" - , "file names to consider for searching." + , "file names to consider for searching. If the header file defines the" + , "symbol as a macro it is considered available and assumed to work." ] , "size_ctype": [ "Set a define to size of the specified C type. Must contain a list of" @@ -300,13 +302,21 @@ , "shift" , "DEFINE=\"/* #undef $DEF */\"" , "for INC in \"$@\"; do" - , " cat > test.$LANG << EOF" + , " cat > test_symbol.$LANG << EOF" , "#include \"$INC\"" - , "#ifndef $SYMBOL" , "void* __test = &$SYMBOL;" + , "EOF" + , " if $CC @$LANG.flags -c test_symbol.$LANG -I ./include 2>/dev/null; then" + , " DEFINE=\"#define $DEF 1\"" + , " break" + , " fi" + , " cat > test_macro.$LANG << EOF" + , "#include \"$INC\"" + , "#ifndef $SYMBOL" + , "#error not defined as macro" , "#endif" , "EOF" - , " if $CC @$LANG.flags -c test.$LANG -I ./include 2>/dev/null; then" + , " if $CC @$LANG.flags -c test_macro.$LANG -I ./include 2>/dev/null; then" , " DEFINE=\"#define $DEF 1\"" , " break" , " fi" |