Disable extraneous WIN32 declarations when including windows.h in epicsAtomicOSD.h
This commit is contained in:
@ -19,27 +19,50 @@
|
|||||||
|
|
||||||
#define EPICS_ATOMIC_OS_NAME "WIN32"
|
#define EPICS_ATOMIC_OS_NAME "WIN32"
|
||||||
|
|
||||||
#ifdef VC_EXTRALEAN
|
/* Disable extra declarations that we don't need here (i.e. winsock1, rpc, etc.) */
|
||||||
# define VC_EXTRALEAN_DETECTED_epicsAtomicOSD_h
|
#pragma push_macro("WIN32_LEAN_AND_MEAN")
|
||||||
#else
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
# define VC_EXTRALEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef STRICT
|
#pragma push_macro("STRICT")
|
||||||
# define STRICT_DETECTED_epicsAtomicOSD_h
|
#undef STRICT
|
||||||
#else
|
#define STRICT
|
||||||
# define STRICT
|
|
||||||
#endif
|
/* Disable min/max macros from windows.h. These macros can cause issues with headers such as <algorithm> that declare or use std::min/max */
|
||||||
|
#pragma push_macro("NOMINMAX")
|
||||||
|
#undef NOMINMAX
|
||||||
|
#define NOMINMAX
|
||||||
|
|
||||||
|
/* Disable 'service controller' includes */
|
||||||
|
#pragma push_macro("NOSERVICE")
|
||||||
|
#undef NOSERVICE
|
||||||
|
#define NOSERVICE
|
||||||
|
|
||||||
|
/* Disable 'input management engine' includes */
|
||||||
|
#pragma push_macro("NOIME")
|
||||||
|
#undef NOIME
|
||||||
|
#define NOIME
|
||||||
|
|
||||||
|
/* Disable 'modem configuration extensions' includes */
|
||||||
|
#pragma push_macro("NOMCX")
|
||||||
|
#undef NOMCX
|
||||||
|
#define NOMCX
|
||||||
|
|
||||||
|
/* Disable GDI includes */
|
||||||
|
#pragma push_macro("NOGDI")
|
||||||
|
#undef NOGDI
|
||||||
|
#define NOGDI
|
||||||
|
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
|
|
||||||
#ifndef VC_EXTRALEAN_DETECTED_epicsAtomicOSD_h
|
/* Restore previous macro values */
|
||||||
# undef VC_EXTRALEAN
|
#pragma pop_macro("WIN32_LEAN_AND_MEAN")
|
||||||
#endif
|
#pragma pop_macro("STRICT")
|
||||||
|
#pragma pop_macro("NOMINMAX")
|
||||||
#ifndef STRICT_DETECTED_epicsAtomicOSD_h
|
#pragma pop_macro("NOSERVICE")
|
||||||
# undef STRICT
|
#pragma pop_macro("NOIME")
|
||||||
#endif
|
#pragma pop_macro("NOMCX")
|
||||||
|
#pragma pop_macro("NOGDI")
|
||||||
|
|
||||||
#if defined ( _WIN64 )
|
#if defined ( _WIN64 )
|
||||||
# define MS_ATOMIC_64
|
# define MS_ATOMIC_64
|
||||||
|
Reference in New Issue
Block a user