I have to compile an API on Mac using Clang that uses a construct similar to this:
#define TRUE 1
void func(int a) {
// ...
}
void func(double a) {
// ...
}
void func(float a) {
// ...
}
func(TRUE);
Clang complains that the call to func()
is ambiguous while MSVC and GCC don't. Is there an option for Clang that it will choose the integer variant in this case?
Edit: This is the original output of the compilation
../../resource/_api/c4d_basedocument.cpp:263:52: error: conversion from 'int' to 'const GeData' is ambiguous
this->SetParameter(DescLevel(DOCUMENT_USERCHANGE),TRUE,DESCFLAGS_SET_DONTCHECKMINMAX);
^~~~
../../resource/_api/ge_sys_math.h:21:15: note: expanded from macro 'TRUE'
#define TRUE 1
^
../../resource/_api/c4d_gedata.h:97:3: note: candidate constructor
GeData(double n)
^
../../resource/_api/c4d_gedata.h:110:3: note: candidate constructor
GeData(LONG n)
^
../../resource/_api/c4d_gedata.h:116:3: note: candidate constructor
GeData(SReal n)
^
LONG
is an integral type, SReal
a floating point type.