windows-nt/Source/XPSP1/NT/base/win32/fusion/tools/sharinghazardcheck/casts.h

21 lines
539 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
#pragma once
#if !defined(__cplusplus)
typedef enum bool { false, true } bool;
#if !defined(CONST_CAST)
#define CONST_CAST(t) (t)
#endif
#define STATIC_CAST(t) (t)
#define REINTERPRET_CAST(t) (t)
#define INT_TO_ENUM_CAST(e) /* nothing */
#define FUNCTION_POINTER_CAST(t) (t)
#else
#if !defined(CONST_CAST)
#define CONST_CAST(t) const_cast<t>
#endif
#define STATIC_CAST(t) static_cast<t>
#define INT_TO_ENUM_CAST(e) static_cast<e>
#define REINTERPRET_CAST(t) reinterpret_cast<t>
#define FUNCTION_POINTER_CAST(t) reinterpret_cast<t>
#endif