Generating .di header files from ImportC files

d007 d007 at gmail.com
Sat Nov 25 05:42:20 UTC 2023


On Saturday, 25 November 2023 at 05:21:55 UTC, Walter Bright 
wrote:
> On 11/11/2023 12:02 AM, d007 wrote:
>> dmd -c fuse.i -Hf=fuse.di
>> 
>> /usr/include/x86_64-linux-gnu/bits/byteswap.h(34): Error: 
>> missing comma or semicolon after declaration of `__uint16_t`, 
>> found `__bswap_16` instead
>
> Try isolating the lines in byteswap.h that cause the error.


I am not sure what cloud be done with this,  here is the code 
from `/usr/include/x86_64-linux-gnu/bits/byteswap.h`

```c

#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined 
_ENDIAN_H
# error "Never use <bits/byteswap.h> directly; include 
<byteswap.h> instead."
#endif

#ifndef _BITS_BYTESWAP_H
#define _BITS_BYTESWAP_H 1

#include <features.h>
#include <bits/types.h>

/* Swap bytes in 16-bit value.  */
#define __bswap_constant_16(x)                  \
   ((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))


static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{
#if __GNUC_PREREQ (4, 8)
   return __builtin_bswap16 (__bsx);
#else
   return __bswap_constant_16 (__bsx);
#endif
}
```


More information about the Digitalmars-d mailing list