yasm/libyasm-stdint.h.cmake
Biswapriyo Nath a277a590f0
Fix detecting Windows platform (#204)
This replaces _MSC_VER macro with _WIN32 because the
former one is for MSVC and Visual Studio only and is
not defined in mingw environment. Wherease, _WIN32
macro is the proper way to check Windows platform
irrespective of compiler toolchain.

See the following official link for more info
https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros
2023-05-12 21:06:53 -07:00

46 lines
805 B
CMake

#ifndef YASM_STDINT_H
#define YASM_STDINT_H
#cmakedefine HAVE_STDINT_H
#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif defined(_MSC_VER)
#ifndef _UINTPTR_T_DEFINED
#ifdef _WIN64
#include <vadefs.h>
#else
typedef unsigned long uintptr_t;
#endif
#define _UINTPTR_T_DEFINED
#endif
#else
typedef unsigned long uintptr_t;
#endif
#ifndef BUILD_SHARED_LIBS
#cmakedefine BUILD_SHARED_LIBS
#define BUILD_SHARED_LIBS_UNDEF
#endif
#ifndef YASM_LIB_DECL
# if defined(BUILD_SHARED_LIBS) && defined(_WIN32)
# ifdef YASM_LIB_SOURCE
# define YASM_LIB_DECL __declspec(dllexport)
# else
# define YASM_LIB_DECL __declspec(dllimport)
# endif
# else
# define YASM_LIB_DECL
# endif
#endif
#undef HAVE_STDINT_H
#ifdef BUILD_SHARED_LIBS_UNDEF
#undef BUILD_SHARED_LIBS
#undef BUILD_SHARED_LIBS_UNDEF
#endif
#endif