C code using FB keywords as identifiers:
typedef int INT;
void open(void);
Type INT_ As Long
Declare Sub open_ cdecl Alias "open"()
C code relying on case-sensitivity:
void foo(void);
void Foo(void);
void FOO(void);
'' Wrong translation:
Extern "C"
Declare Sub foo()
Declare Sub Foo() '' error: duplicate definition
Declare Sub FOO() '' error: duplicate definition
End Extern
'' Correct translation:
Extern "C"
Declare Sub foo()
Declare Sub Foo_ Alias "Foo"()
Declare Sub FOO__ Alias "FOO"()
End Extern
Another classic example where this kind of conflict happens:
#define GET_VERSION_NUMBER 123
int get_version_number(void);
Extern "C"
#define GET_VERSION_NUMBER_ 123 '' renamed to avoid conflict
Declare Function get_version_number() As Long
End Extern
Conflict between procedure and macro:
void f(int);
#define f(i) f(i + 1)
Extern "C"
Declare Sub f(ByVal As Long)
#define f_(i) f(i + 1) '' renamed to avoid conflict
End Extern