Thread overview
[Issue 24811] Cant compile C code
Oct 15
barbosso
Oct 16
barbosso
Oct 24
RazvanN
Oct 24
barbosso
October 15
https://issues.dlang.org/show_bug.cgi?id=24811

--- Comment #1 from barbosso <my-ijet@mail.ru> ---
I found possible solution
This error occure with inclusion of "/usr/include/bits/floatn-common.h" system
lib
to prevent error you can define __GNUC__ to be greater than 7
(for example - comment definition)

//lib.c
#define __GNUC__ 8
#include <bits/floatn-common.h>
//

clang -c lib.c # compile OK
dmd -c lib.c   # compile OK with WARNING
lib.c:1:9: warning: '__GNUC__' macro redefined [-Wmacro-redefined]
1 | #define __GNUC__ 8
|         ^
<built-in>:7:9: note: previous definition is here
7 | #define __GNUC__ 4
|         ^

--
October 16
https://issues.dlang.org/show_bug.cgi?id=24811

--- Comment #2 from barbosso <my-ijet@mail.ru> ---
SDL3 with callbacks also cant compile
How to reproduce

//SDL3.c
#define __GNUC__ 8
#define SDL_MAIN_USE_CALLBACKS 1 /* use the callbacks instead of main$
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
//

clang -c SDL3.c # compile OK
ldc -c SDL3.c   # compile ERRORS
/usr/include/SDL3/SDL_stdinc.h(4294): Error: undefined identifier
`__builtin_mul_overflow`
/usr/include/SDL3/SDL_stdinc.h(4332): Error: undefined identifier
`__builtin_add_overflow`
/usr/include/SDL3/SDL_bits.h(79): Error: undefined identifier `__builtin_clz`

--
October 24
https://issues.dlang.org/show_bug.cgi?id=24811

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |betterC
                 CC|                            |razvan.nitu1305@gmail.com

--
October 24
https://issues.dlang.org/show_bug.cgi?id=24811

barbosso <my-ijet@mail.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|betterC                     |ImportC

--