Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 22:00:16 UTC, Ferhat Kurtulmuş 
wrote:
On Saturday, 13 April 2024 at 21:41:41 UTC, Ferhat Kurtulmuş 
wrote:
On Saturday, 13 April 2024 at 21:39:10 UTC, Ferhat Kurtulmuş 
wrote:
On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) 
Andrew Cattermole wrote:

[...]


Another question how can one define a preprocessor var for a 
c source from dub.json?


for instance: c source has #ifdef ORT_DLL_IMPORT

normally we do it like -D ORT_DLL_IMPORT


ohh I found it: -P


no this does not work:

"dflags": ["-P=SOME_FLAG"],

c1: fatal error C1083: Cannot open source file: 'SOME_FLAG': No 
such file or directory


The docs need an example. I was too stupid to figure this out 
quickly. "-P-DORT_DLL_IMPORT"


Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 21:41:41 UTC, Ferhat Kurtulmuş 
wrote:
On Saturday, 13 April 2024 at 21:39:10 UTC, Ferhat Kurtulmuş 
wrote:
On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) 
Andrew Cattermole wrote:

On 14/04/2024 8:59 AM, Ferhat Kurtulmuş wrote:


These don't work for me:

"dflags": ["-Iinclude"]

"importPaths": [
     "include"
],

The importc docs do not help either.


Appears it hasn't been documented in new dub docs.

It is ``cSourcePaths`` and ``cImportPaths``.

https://github.com/dlang/dub-docs/issues/91


Another question how can one define a preprocessor var for a c 
source from dub.json?


for instance: c source has #ifdef ORT_DLL_IMPORT

normally we do it like -D ORT_DLL_IMPORT


ohh I found it: -P


no this does not work:

"dflags": ["-P=SOME_FLAG"],

c1: fatal error C1083: Cannot open source file: 'SOME_FLAG': No 
such file or directory


Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 21:39:10 UTC, Ferhat Kurtulmuş 
wrote:
On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) 
Andrew Cattermole wrote:

On 14/04/2024 8:59 AM, Ferhat Kurtulmuş wrote:


These don't work for me:

"dflags": ["-Iinclude"]

"importPaths": [
     "include"
],

The importc docs do not help either.


Appears it hasn't been documented in new dub docs.

It is ``cSourcePaths`` and ``cImportPaths``.

https://github.com/dlang/dub-docs/issues/91


Another question how can one define a preprocessor var for a c 
source from dub.json?


for instance: c source has #ifdef ORT_DLL_IMPORT

normally we do it like -D ORT_DLL_IMPORT


ohh I found it: -P


Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) 
Andrew Cattermole wrote:

On 14/04/2024 8:59 AM, Ferhat Kurtulmuş wrote:


These don't work for me:

"dflags": ["-Iinclude"]

"importPaths": [
     "include"
],

The importc docs do not help either.


Appears it hasn't been documented in new dub docs.

It is ``cSourcePaths`` and ``cImportPaths``.

https://github.com/dlang/dub-docs/issues/91


Another question how can one define a preprocessor var for a c 
source from dub.json?


for instance: c source has #ifdef ORT_DLL_IMPORT

normally we do it like -D ORT_DLL_IMPORT


Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) 
Andrew Cattermole wrote:

On 14/04/2024 8:59 AM, Ferhat Kurtulmuş wrote:


These don't work for me:

"dflags": ["-Iinclude"]

"importPaths": [
     "include"
],

The importc docs do not help either.


Appears it hasn't been documented in new dub docs.

It is ``cSourcePaths`` and ``cImportPaths``.

https://github.com/dlang/dub-docs/issues/91


thank you Rikki.




Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn

On 14/04/2024 8:59 AM, Ferhat Kurtulmuş wrote:


These don't work for me:

"dflags": ["-Iinclude"]

"importPaths": [
     "include"
],

The importc docs do not help either.


Appears it hasn't been documented in new dub docs.

It is ``cSourcePaths`` and ``cImportPaths``.

https://github.com/dlang/dub-docs/issues/91


How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn



These don't work for me:

"dflags": ["-Iinclude"]

"importPaths": [
"include"
],

The importc docs do not help either.


Re: How can I tell D that function args are @nogc etc.

2024-04-13 Thread Monkyyy via Digitalmars-d-learn

On Friday, 12 April 2024 at 03:57:40 UTC, John Dougan wrote:

 Not every day you get to blame a compiler bug.



D is uniquely: hacky, expressive and buggy.

Having more metaprograming then c++ without the raw man power 
comes at a cost, in d you should distrust the spec and instead 
see what the compiler actually does far more then any other 
languge.





-- john


-- monkyyy