Re: importC and cmake

2022-09-27 Thread Chris Piker via Digitalmars-d-learn
On Wednesday, 7 September 2022 at 00:31:53 UTC, zjh wrote: `xmake` is simpler. Thanks for the recommendation. Was struggling with cmake for a dependent clib. Xmake is indeed simpler.

Re: Template function alias that leaves out the last type parameter

2022-09-27 Thread torhu via Digitalmars-d-learn
On Tuesday, 27 September 2022 at 23:18:06 UTC, Adam D Ruppe wrote: On Tuesday, 27 September 2022 at 22:39:52 UTC, torhu wrote: How would I achieve something like this, do I have to turn the aliases into functions? You can write it out long-form with two steps like this: Thank you, works

Re: Template function alias that leaves out the last type parameter

2022-09-27 Thread Adam D Ruppe via Digitalmars-d-learn
On Tuesday, 27 September 2022 at 22:39:52 UTC, torhu wrote: How would I achieve something like this, do I have to turn the aliases into functions? You can write it out long-form with two steps like this: --- template _messageBox(string title, int style) { void _messageBox(T...)(T

Re: Template function alias that leaves out the last type parameter

2022-09-27 Thread torhu via Digitalmars-d-learn
On Tuesday, 27 September 2022 at 22:39:52 UTC, torhu wrote: How would I achieve something like this, do I have to turn the aliases into functions? ```d void _messageBox(string title, int style, T...)(T args) { string s = format(args); /* etc... */ } alias _messageBox!(APPNAME,

Template function alias that leaves out the last type parameter

2022-09-27 Thread torhu via Digitalmars-d-learn
How would I achieve something like this, do I have to turn the aliases into functions? ```d void _messageBox(string title, int style, T...)(T args) { string s = format(args); /* etc... */ } alias _messageBox!(APPNAME, SWT.ICON_INFORMATION) info; alias _messageBox!("Warning",

Re: Is there a way to mark a dub package as linux only?

2022-09-27 Thread rikki cattermole via Digitalmars-d-learn
On 28/09/2022 7:18 AM, Alain De Vos wrote: Don't forget there is also BSD Should already be supported. Platform specific settings are supported through the use of field name suffixes. Suffixes are dash separated list of operating system/architecture/compiler identifiers, as defined in the D

Re: Is there a way to mark a dub package as linux only?

2022-09-27 Thread Alain De Vos via Digitalmars-d-learn
Don't forget there is also BSD

Re: Is there a way to mark a dub package as linux only?

2022-09-27 Thread rikki cattermole via Digitalmars-d-learn
Alternatively we could just extend platforms to work in places other than configurations. https://dub.pm/package-format-json.html#configuration-settings

Re: Is there a way to mark a dub package as linux only?

2022-09-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/26/22 4:57 PM, Christian Köstlin wrote: Or posix only? Or not windows? Kind regards, Christian We have specific directives based on os, I had an idea that you could say something like: ```json "dependencies-windows": { "not-available" : "*" } ``` But it still tries to find this

Re: Is there a way to mark a dub package as linux only?

2022-09-27 Thread Christian Köstlin via Digitalmars-d-learn
On 27.09.22 13:07, Ahmet Sait wrote: On Monday, 26 September 2022 at 20:57:06 UTC, Christian Köstlin wrote: Or posix only? Or not windows? Kind regards, Christian Not necessarily a dub solution but you can do something like this: ```d version(Posix) { } else     static assert(0,

Re: Is there a way to mark a dub package as linux only?

2022-09-27 Thread Ahmet Sait via Digitalmars-d-learn
On Monday, 26 September 2022 at 20:57:06 UTC, Christian Köstlin wrote: Or posix only? Or not windows? Kind regards, Christian Not necessarily a dub solution but you can do something like this: ```d version(Posix) { } else static assert(0, "Unsupported platform."); ``` This will result in