October 28
On Friday, 27 October 2023 at 01:44:01 UTC, Walter Bright wrote:
> On 10/25/2023 9:33 AM, Dave P. wrote:
>> I’ve filed some bugs that block this feature from being useful:
>
> Thank you. It's nice to see the interest in this feature!

Don't hurt me, but would the solution I present in this bug work?
https://issues.dlang.org/show_bug.cgi?id=24132#c4
October 28
On Saturday, 28 October 2023 at 09:50:19 UTC, Adam Wilson wrote:
> On Friday, 27 October 2023 at 01:44:01 UTC, Walter Bright wrote:
>> On 10/25/2023 9:33 AM, Dave P. wrote:
>>> I’ve filed some bugs that block this feature from being useful:
>>
>> Thank you. It's nice to see the interest in this feature!
>
> Don't hurt me, but would the solution I present in this bug work?
> https://issues.dlang.org/show_bug.cgi?id=24132#c4

Interesting. Need to try and see what happens :D
November 11

On Monday, 23 October 2023 at 18:00:39 UTC, Walter Bright wrote:

>

On 10/23/2023 9:08 AM, d007 wrote:

>

Error: unrecognized file extension h

That's because recognizing h files caused Iain problems building gdc.

To deal with:

--- file.c ---
#include "file.h"

today I try use importC with libfuse3.

DMD64 D Compiler v2.106.0-beta.1

dmd -c fuse.c -Hf=fuse.di
fuse.c:1:10: fatal error: fuse3/fuse.h: No such file or directory
    1 | #include "fuse3/fuse.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
Error: C preprocess command cpp failed for file fuse.c, exit status 1

I am not sure how to pass c flags into dmd here, and I can not find document about this.

try with:

clang -E $dir/fuse.c -o fuse.i -I./include -DFUSE_USE_VERSION=30

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
/usr/include/x86_64-linux-gnu/bits/byteswap.h(41): Error: no type for declarator before `}`
/usr/include/x86_64-linux-gnu/bits/byteswap.h(49): Error: missing comma or semicolon after declaration of `__uint32_t`, found `__bswap_32` instead
/usr/include/x86_64-linux-gnu/bits/byteswap.h(56): Error: no type for declarator before `}`
/usr/include/x86_64-linux-gnu/bits/byteswap.h(69): Error: missing comma or semicolon after declaration of `__inline`, found `__uint64_t` instead
/usr/include/x86_64-linux-gnu/bits/byteswap.h(77): Error: no type for declarator before `}`
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h(33): Error: missing comma or semicolon after declaration of `__uint16_t`, found `__uint16_identity` instead
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h(36): Error: no type for declarator before `}`
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h(39): Error: missing comma or semicolon after declaration of `__uint32_t`, found `__uint32_identity` instead
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h(42): Error: no type for declarator before `}`
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h(45): Error: missing comma or semicolon after declaration of `__uint64_t`, found `__uint64_identity` instead
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h(48): Error: no type for declarator before `}`
/usr/include/x86_64-linux-gnu/sys/select.h(102): Error: found `__readfds` when expecting `,`
/usr/include/x86_64-linux-gnu/sys/select.h(102): Error: no type-specifier for parameter
/usr/include/x86_64-linux-gnu/sys/select.h(103): Error: found `__writefds` when expecting `,`
/usr/include/x86_64-linux-gnu/sys/select.h(103): Error: no type-specifier for parameter
/usr/include/x86_64-linux-gnu/sys/select.h(104): Error: found `__exceptfds` when expecting `,`
/usr/include/x86_64-linux-gnu/sys/select.h(104): Error: no type-specifier for parameter
/usr/include/x86_64-linux-gnu/sys/select.h(105): Error: found `__timeout` when expecting `,`
/usr/include/x86_64-linux-gnu/sys/select.h(127): Error: found `__readfds` when expecting `,`

I use debian 12 amd64.

November 25

On Saturday, 11 November 2023 at 08:02:29 UTC, d007 wrote:

>

On Monday, 23 October 2023 at 18:00:39 UTC, Walter Bright wrote:

>

[...]

today I try use importC with libfuse3.

DMD64 D Compiler v2.106.0-beta.1

[...]

Tips ?

Walter Bright ?

November 24
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.

November 25

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


#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
}
December 27
On Saturday, 21 October 2023 at 02:13:24 UTC, Walter Bright wrote:
> ...

Great hidden feature!

I just tried this out for converting the libsodium headers into a .di file. It requires a little work before turning it into a .di (e.g. removing extensions) and then a little bit after (since the compiler generates code like `void someFunc(const struct someStruct* param1)`.

But after a few seds and a small D script to remove declarations I don't care about, it actually wasn't too painful compared to using something like dstep which is a 50/50 gamble on whether it works, and is a much bigger pain to automatically clean the output of.
December 27
Thank you

https://issues.dlang.org/show_bug.cgi?id=24304
1 2 3 4
Next ›   Last »