Skip to content

Conversation

@Emmankoko
Copy link
Contributor

No description provided.

@dlang-bot
Copy link
Contributor

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: and Returns:)

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"

@WalterBright
Copy link
Member

A description of what this does would be helpful.

@Emmankoko
Copy link
Contributor Author

Emmankoko commented Dec 8, 2025

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.

@Emmankoko Emmankoko force-pushed the mcf branch 2 times, most recently from 23984d3 to befc696 Compare December 11, 2025 07:34
@Emmankoko Emmankoko closed this Jan 6, 2026
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

Successfully merging this pull request may close these issues.

3 participants