https://issues.dlang.org/show_bug.cgi?id=23513

Alex Bryan <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #3 from Alex Bryan <[email protected]> ---
It seems like the root of the problem is an inability for importC to convert
function like macros that are able to be evaluated at compile time into enum
definitions. For example:

alex@compy  programming/importc_test dmd --version                             
                                                                               
                 19:33:22 23-02-14
DMD64 D Compiler v2.102.0
Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved
written by Walter Bright
alex@compy  programming/importc_test cat source/foo.h                          
                                                                               
                 19:33:28 23-02-14
#define CONSTANT 6
#define CONTSTANT_PLUS (6 + 1)
alex@compy  programming/importc_test cat source/foo.c                          
                                                                               
                 19:34:02 23-02-14
#include "foo.h"
alex@compy  programming/importc_test cat source/app.d                          
                                                                               
                 19:34:03 23-02-14
import std.stdio;
import foo;

void main()
{
        writeln("%d", CONSTANT); //works
        writeln("%d", CONSTANT_PLUS); //does not work
}
alex@compy  programming/importc_test dmd source/*.d source/*.c                 
                                                                               
                 19:34:08 23-02-14
source/app.d(7): Error: undefined identifier `CONSTANT_PLUS`
alex@compy  programming/importc_test dub build                                 
                                                                               
                 19:36:10 23-02-14
    Starting Performing "debug" build using /usr/bin/dmd for x86_64.
    Building importc_test ~master: building configuration [application]
source/app.d(7,16): Error: undefined identifier `CONSTANT_PLUS`
Error /usr/bin/dmd failed with exit code 1.

--

Reply via email to