mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
New definition of C_ASSERT and _STATIC_ASSERT using a function prototype. This way we avoid duplicate definition errors like with a typedef and unused function warning like with the extern.
svn path=/branches/ros-amd64-bringup/; revision=44623
This commit is contained in:
@@ -90,7 +90,7 @@ extern "C" {
|
||||
} _CrtMemState;
|
||||
|
||||
#ifndef _STATIC_ASSERT
|
||||
#define _STATIC_ASSERT(expr) typedef char __static_assert_t[(expr)?1:-1]
|
||||
#define _STATIC_ASSERT(expr) char __static_assert_p(char static_assert[(expr)?1:-1])
|
||||
#endif
|
||||
|
||||
#ifndef _ASSERT
|
||||
|
||||
@@ -25,7 +25,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _STATIC_ASSERT
|
||||
#define _STATIC_ASSERT(expr) typedef char __static_assert_t[(expr)?1:-1]
|
||||
#define _STATIC_ASSERT(expr) char __static_assert_p(char static_assert[(expr)?1:-1])
|
||||
#endif
|
||||
|
||||
/* Return codes for _heapwalk() */
|
||||
|
||||
@@ -694,7 +694,7 @@ typedef struct _SINGLE_LIST_ENTRY {
|
||||
// C_ASSERT Definition
|
||||
//
|
||||
#define C_ASSERT(exp) \
|
||||
extern char __c_assert__[exp ? 1 : -1];
|
||||
char __c_assert_p(char c_assert[(exp)?1:-1])
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ typedef WORD FSHORT;
|
||||
typedef DWORD FLONG;
|
||||
|
||||
#define C_ASSERT(exp) \
|
||||
extern char __c_assert__[exp ? 1 : -1];
|
||||
char __c_assert_p(char c_assert[(exp)?1:-1])
|
||||
|
||||
#include "intrin.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user