blob: e761ab1a43a2f22d57198210a376888a6d528aec [file] [log] [blame]
clang with libc++ does not like using void* function pointer with sqrt.
Update waflib config to detect sqrt function using the correct
c++ function pointer syntax.
Fixes glmark2 build when using libc++ in clang.
diff -Nuar old/waflib/Tools/c_config.py new/waflib/Tools/c_config.py
--- old/waflib/Tools/c_config.py
+++ new/waflib/Tools/c_config.py
@@ -12,6 +12,13 @@
DEFKEYS='define_key'
INCKEYS='include_key'
cfg_ver={'atleast-version':'>=','exact-version':'==','max-version':'<=',}
+SNIP_FUNCTION_SQRT='''
+ int main() {
+ double (*p)(double);
+ p=(%s);
+ return 0;
+}
+'''
SNIP_FUNCTION='''
int main() {
void *p;
@@ -250,7 +257,10 @@
fu=kw['function_name']
if not'msg'in kw:
kw['msg']='Checking for function %s'%fu
- kw['code']=to_header(kw)+SNIP_FUNCTION%fu
+ if (fu == 'sqrt') :
+ kw['code']=to_header(kw)+SNIP_FUNCTION_SQRT%fu
+ else:
+ kw['code']=to_header(kw)+SNIP_FUNCTION%fu
if not'uselib_store'in kw:
kw['uselib_store']=fu.upper()
if not'define_name'in kw: