diff options
author | Sean McGovern <[email protected]> | 2016-07-10 16:00:16 -0400 |
---|---|---|
committer | Sean McGovern <[email protected]> | 2016-07-10 16:24:32 -0400 |
commit | e44e48382e1a97815f005e3efd6c36c06c773c40 (patch) | |
tree | a5854c9fa3a1a3c867783c42db8bc1acc813635a /make/configure.py | |
parent | 0fc54d0b67c84c6ef571752de1b4a7f482e40792 (diff) |
configure: check for strerror_r()
Diffstat (limited to 'make/configure.py')
-rw-r--r-- | make/configure.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/make/configure.py b/make/configure.py index e75ca2872..3efb6848b 100644 --- a/make/configure.py +++ b/make/configure.py @@ -1726,6 +1726,23 @@ int main () strtok_r = LDProbe( 'static strtok_r', '%s -static' % Tools.gcc.pathname, '', strtok_r_test ) strtok_r.run() + strerror_r_test = """ +#include <string.h> + +int main() +{ + /* some implementations fail if buf is less than 80 characters + so size it appropriately */ + char errstr[128]; + /* some implementations fail if err == 0 */ + strerror_r(1, errstr, 127); + return 0; +} +""" + + strerror_r = LDProbe( 'strerror_r', '%s' % Tools.gcc.pathname, '', strerror_r_test ) + strerror_r.run() + ## cfg hook before doc prep cfg.doc_ready() @@ -1858,6 +1875,10 @@ int main () doc.add( 'HAS.regex', 1 ) if strtok_r.fail: doc.add( 'COMPAT.strtok_r', 1 ) + else: + doc.addBlank() + if not strerror_r.fail: + doc.add( 'HAS.strerror_r', 1 ) doc.addMake( '' ) doc.addMake( '## define debug mode and optimize before other includes' ) |