Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on #define foo = 0 #220

Open
arkanoid87 opened this issue Aug 14, 2021 · 2 comments
Open

Error on #define foo = 0 #220

arkanoid87 opened this issue Aug 14, 2021 · 2 comments

Comments

@arkanoid87
Copy link

#define foo = 0
int i foo;

should result in

int i = 0

but c2nim returns "Error: did not expect ="

there's a way to handle this with c2nim or should I "gcc -P -C -E" first?

@Araq
Copy link
Member

Araq commented Aug 16, 2021

Read the manual and use

#def foo = 0
int i foo;

@arkanoid87
Copy link
Author

thanks for the answer, I'd like to point out that skipping same define using assumendef seems not working

#ifdef C2NIM
#  assumendef WITH_PURE_VIRTUAL
#  assumendef WITH_DEFAULT_VIRTUAL
#endif

#if defined(WITH_PURE_VIRTUAL)
# define SOAP_PURE_VIRTUAL = 0
# define SOAP_PURE_VIRTUAL_COPY = 0
#elif defined(WITH_DEFAULT_VIRTUAL)
# define SOAP_PURE_VIRTUAL { return SOAP_NO_METHOD; }
# define SOAP_PURE_VIRTUAL_COPY
#else
# define SOAP_PURE_VIRTUAL
# define SOAP_PURE_VIRTUAL_COPY
#endif

output

stdsoap2.h(7, 31) Error: did not expect =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants