mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 06:25:12 +00:00
osdep.h: Define macros for the benefit of C++ before C++11
For C++ before C++11, <stdint.h> requires definition of the macros __STDC_CONSTANT_MACROS, __STDC_LIMIT_MACROS and __STDC_FORMAT_MACROS in order to enable definition of various macros by the header file. Define these in osdep.h, so that we get the right header file definitions whether osdep.h is being used by plain C, C++11 or older C++. In particular libvixl's header files depend on this and won't compile if osdep.h is included before them otherwise. Backports commit 79f56d82f805b170fa2be8c04b682117be56483f from qemu
This commit is contained in:
parent
6094a0373c
commit
c41bb9a772
|
@ -26,6 +26,23 @@
|
|||
#define QEMU_OSDEP_H
|
||||
|
||||
#include "config-host.h"
|
||||
#include "qemu/compiler.h"
|
||||
|
||||
/* Older versions of C++ don't get definitions of various macros from
|
||||
* stdlib.h unless we define these macros before first inclusion of
|
||||
* that system header.
|
||||
*/
|
||||
#ifndef __STDC_CONSTANT_MACROS
|
||||
#define __STDC_CONSTANT_MACROS
|
||||
#endif
|
||||
#ifndef __STDC_LIMIT_MACROS
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#endif
|
||||
#ifndef __STDC_FORMAT_MACROS
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include "unicorn/platform.h"
|
||||
|
|
Loading…
Reference in a new issue