[Issue 23513] ImportC doesn't export ncurses' attributes (C macros)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 15 00:37:58 UTC 2023


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

Alex Bryan <abryancs at proton.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abryancs at proton.me

--- Comment #3 from Alex Bryan <abryancs at proton.me> ---
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 at 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 at compy  programming/importc_test cat source/foo.h                          
                                                                               
                 19:33:28 23-02-14
#define CONSTANT 6
#define CONTSTANT_PLUS (6 + 1)
alex at compy  programming/importc_test cat source/foo.c                          
                                                                               
                 19:34:02 23-02-14
#include "foo.h"
alex at 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 at 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 at 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.

--


More information about the Digitalmars-d-bugs mailing list