Macro function
Thanks for your pull request and interest in making D better, @Emmankoko! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:
- My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
- My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
- I have provided a detailed rationale explaining my changes
- New or modified functions have Ddoc comments (with
Params:andReturns:)
Please see CONTRIBUTING.md for more information.
If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#22144"
A description of what this does would be helpful.
A description of what this does would be helpful.
I am actually trying to resolve #define variable some_function where the macro holds the return value of the function.
I try to create a variable with the function call as an initializer in D.
auto variale = some_function(x,y);
but for now, it is being blocked by Phobos zlib
#define __STDC__ 1#defines(1): Error: zlibVersion cannot be interpreted at compile time, because it has no available source code
this in zlib.h
#define zlib_version zlibVersion()
/* for compatibility with versions < 1.0.2 */
/* basic functions */
ZEXTERN const char * ZEXPORT zlibVersion(void);
but the implementation of zlibVersion is in zlib.c so ctfe picks the declaration in the header and does not see a function body. I am actually thinking of how to handle that.