[Issue 24389] importC: Building zlib in Phobos with importC fails on FreeBSD 14

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 13 11:52:38 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24389

--- Comment #5 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Iain Buclaw from comment #4)
> (In reply to Jonathan M Davis from comment #2)
> > ---
> > void __qsort_r_compat(void *, size_t, size_t, void *,
> >      int (*)(void *, const void *, const void *));
> > __asm__(".symver " "__qsort_r_compat" ", " "qsort_r" "@" "FBSD_1.0");
> > ---
> I know what that is - as far as I'm aware as of writing, the ImportC parser
> does not support top-level asm declarations.
FYI https://gcc.gnu.org/onlinedocs/gcc/Basic-Asm.html#Remarks

"""
Extended asm statements have to be inside a C function, so to write inline
assembly language at file scope (“top-level”), outside of C functions, you must
use basic asm.

You can use this technique to emit assembler directives, define assembly
language macros that can be invoked elsewhere in the file, or write entire
functions in assembly language.

Basic asm statements outside of functions may not use any qualifiers.
"""

--


More information about the Digitalmars-d-bugs mailing list