8000 define __STDC_FORMAT_MACROS under older glibc by mrpre · Pull Request #266 · WAVM/WAVM · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

define __STDC_FORMAT_MACROS under older glibc #266

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrpre
Copy link
Contributor
@mrpre mrpre commented Mar 18, 2020

Before this glibc commit, c++ program who useinttypes.h should define __STDC_FORMAT_MACROS macro otherwise macro likePRIu64 will not be defined which will cause comiple error.

The older version of inttypes.h is like following:

#if !defined __cplusplus || defined __STDC_FORMAT_MACROS
#define PRIu64 xxx
#endif 

Adding D__STDC_FORMAT_MACROS is a compatible way to solve this problem.

@AndrewScheidecker
Copy link
Member

IMO it would be better to put this in BasicTypes.h before including inttypes.h. Something like:

#if defined(__GNUC__) && __GNUC__ < 5
#define __STDC_FORMAT_MACROS
#endif

Does WAVM compile on such an old GCC though?

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.

2 participants
0