From 5ffe87e43ebd3c607084c745de702ed7ede0b8be Mon Sep 17 00:00:00 2001 From: Joseph Brill <48932340+jcbrill@users.noreply.github.com> Date: Tue, 12 Dec 2023 10:35:03 -0500 Subject: Add additional CheckFunc test cases and update change notice for CheckFunc. Changes: * add additional CheckFunc test cases to SCons/SConfTests.py * add paragraph tags around change notice for CheckFunc funcargs argument in doc/man/scons.xml --- SCons/SConfTests.py | 15 ++++++++++++++- doc/man/scons.xml | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/SCons/SConfTests.py b/SCons/SConfTests.py index 6e9aa62..08ef25e 100644 --- a/SCons/SConfTests.py +++ b/SCons/SConfTests.py @@ -671,12 +671,25 @@ int main(void) { log_file=self.test.workpath('config.log')) try: - # CheckFunc() + # look for function using default heading r = sconf.CheckFunc('strcpy') assert r, "did not find strcpy" + # no default heading, supply dummy signature r = sconf.CheckFunc('strcpy', '/* header */ char strcpy();') assert r, "did not find strcpy" + # ... supply complete signature, and function args r = sconf.CheckFunc('strcpy', header='/* header */ char *strcpy(char *dest, char *src);', funcargs='"", ""') + # ... supply standard header for prototype, and function args + assert r, "did not find strcpy" + r = sconf.CheckFunc('strcpy', header='#include ', funcargs='"", ""') + # also try in C++ mode + cpp_header = """\ +#ifdef __cplusplus +extern "C" +#endif +char *strcpy(char *dest, char *src); +""" + r = sconf.CheckFunc('strcpy', header=cpp_header, funcargs='"", ""', language="C++") assert r, "did not find strcpy" r = sconf.CheckFunc('hopefullynofunction') assert not r, "unexpectedly found hopefullynofunction" diff --git a/doc/man/scons.xml b/doc/man/scons.xml index e2e6a57..91e8dd7 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -3993,7 +3993,9 @@ Note: if header is supplied, by using the funcargs. + Changed in version 4.7.0: added the funcargs. + Returns a boolean indicating success or failure. -- cgit v0.12