Re: Would appreciate some help porting Q3VM to D (mainly C macros and type conversions)

2024-10-15 Thread drug007 via Digitalmars-d-learn
On 15.10.2024 20:37, Mark Bauermeister wrote: On Tuesday, 15 October 2024 at 16:05:48 UTC, Lance Bachmeier wrote: On Tuesday, 15 October 2024 at 13:30:03 UTC, Mark Bauermeister wrote: On Tuesday, 15 October 2024 at 12:27:42 UTC, barbosso wrote: Are you heard of https://github.com/dkorpel/ctod

Re: Would appreciate some help porting Q3VM to D (mainly C macros and type conversions)

2024-10-15 Thread Mark Bauermeister via Digitalmars-d-learn
On Tuesday, 15 October 2024 at 16:05:48 UTC, Lance Bachmeier wrote: On Tuesday, 15 October 2024 at 13:30:03 UTC, Mark Bauermeister wrote: On Tuesday, 15 October 2024 at 12:27:42 UTC, barbosso wrote: Are you heard of https://github.com/dkorpel/ctod ? I actually used CTOD for part of the transl

Re: Would appreciate some help porting Q3VM to D (mainly C macros and type conversions)

2024-10-15 Thread Lance Bachmeier via Digitalmars-d-learn
On Tuesday, 15 October 2024 at 13:30:03 UTC, Mark Bauermeister wrote: On Tuesday, 15 October 2024 at 12:27:42 UTC, barbosso wrote: Are you heard of https://github.com/dkorpel/ctod ? I actually used CTOD for part of the translation but it wouldn't translate the macros correctly. It turned them

Re: need help to find a way to replace c macro

2024-10-15 Thread ryuukk_ via Digitalmars-d-learn
Try this great tool by denis korpel https://dkorpel.github.io/ctod/ I've been using it every so often to port C stuff, it's been very helpful ```D @nogc nothrow: extern(C): __gshared: union JSCFunctionType { JSCFunction* generic; JSValue function(JSContext* ctx, JSValueConst this_val,

Re: Would appreciate some help porting Q3VM to D (mainly C macros and type conversions)

2024-10-15 Thread Mark Bauermeister via Digitalmars-d-learn
On Tuesday, 15 October 2024 at 12:27:42 UTC, barbosso wrote: Are you heard of https://github.com/dkorpel/ctod ? I actually used CTOD for part of the translation but it wouldn't translate the macros correctly. It turned them into weird string mixins.

Re: need help to find a way to replace c macro

2024-10-15 Thread Dakota via Digitalmars-d-learn
On Tuesday, 15 October 2024 at 12:13:36 UTC, monkyyy wrote: Your probably going to need to simplify that block of code looks awful source code here: https://github.com/bellard/quickjs/blob/master/quickjs.h#L1045

Re: Would appreciate some help porting Q3VM to D (mainly C macros and type conversions)

2024-10-15 Thread barbosso via Digitalmars-d-learn
Are you heard of https://github.com/dkorpel/ctod ?

Re: need help to find a way to replace c macro

2024-10-15 Thread monkyyy via Digitalmars-d-learn
On Tuesday, 15 October 2024 at 12:05:16 UTC, Dakota wrote: ```c typedef union JSCFunctionType { JSCFunction *generic; JSValue (*generic_magic)(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic); JSCFunction *constructor; JSValue (*constructor_magic)(

need help to find a way to replace c macro

2024-10-15 Thread Dakota via Digitalmars-d-learn
```c typedef union JSCFunctionType { JSCFunction *generic; JSValue (*generic_magic)(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic); JSCFunction *constructor; JSValue (*constructor_magic)(JSContext *ctx, JSValueConst new_target, int argc, JSValueC

Would appreciate some help porting Q3VM to D (mainly C macros and type conversions)

2024-10-15 Thread Mark Bauermeister via Digitalmars-d-learn
For the past 2 days I've been trying to port the Q3VM (https://github.com/jnz/q3vm) to D. While most of the code is converted, it's somewhat riddled with cast statements and I'm still having trouble getting it to compile without errors. My conversion can be found here: https://gist.github.com

Re: Error when compiling with C libs

2024-10-15 Thread barbosso via Digitalmars-d-learn
On Sunday, 13 October 2024 at 21:28:41 UTC, Sergey wrote: On Sunday, 13 October 2024 at 20:06:44 UTC, barbosso wrote: error in line ```typedef float _Float32;``` clang can compile that line, but dmd or ldc can not! This is definatly compiler error! It is not an error.. This is just lack in the

Re: Error when compiling with C libs

2024-10-15 Thread barbosso via Digitalmars-d-learn
On Sunday, 13 October 2024 at 21:28:41 UTC, Sergey wrote: On Sunday, 13 October 2024 at 20:06:44 UTC, barbosso wrote: error in line ```typedef float _Float32;``` clang can compile that line, but dmd or ldc can not! This is definatly compiler error! It is not an error.. This is just lack in the