Move #includes out of extern "C" blocks, make STATIC_ASSERT work in C++.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9737 4a71c877-e1ca-e34f-864e-861f7616d084
master
Cyp 2010-02-07 21:39:33 +00:00 committed by Git SVN Gateway
parent 392c08cd3c
commit 4651724689
4 changed files with 16 additions and 6 deletions

View File

@ -1 +1,2 @@
. .
/usr/include/SDL

View File

@ -21,13 +21,13 @@
#ifndef __INCLUDED_LIB_EXCEPTIONHANDLER_DUMPINFO_H__ #ifndef __INCLUDED_LIB_EXCEPTIONHANDLER_DUMPINFO_H__
#define __INCLUDED_LIB_EXCEPTIONHANDLER_DUMPINFO_H__ #define __INCLUDED_LIB_EXCEPTIONHANDLER_DUMPINFO_H__
#include "lib/framework/frame.h"
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" extern "C"
{ {
#endif #endif
#include "lib/framework/frame.h"
#if defined(WZ_OS_WIN) #if defined(WZ_OS_WIN)
typedef HANDLE DumpFileHandle; typedef HANDLE DumpFileHandle;
#else #else

View File

@ -117,8 +117,18 @@ extern bool assertEnabled;
* *
* \note BUILD_BUG_ON_ZERO from <linux/kernel.h> * \note BUILD_BUG_ON_ZERO from <linux/kernel.h>
*/ */
#ifndef __cplusplus
#define STATIC_ASSERT_EXPR( expr ) \ #define STATIC_ASSERT_EXPR( expr ) \
(sizeof(struct { int:-!(expr); })) (sizeof(struct { int:-!(expr); }))
#else //cplusplus
}
template<bool> class StaticAssert;
template<> class StaticAssert<true>{};
#define STATIC_ASSERT_EXPR(expr) \
(sizeof(StaticAssert<(expr)>))
extern "C"
{
#endif //cplusplus
/** /**
* Compile time assert * Compile time assert
* Not to be used in global context! * Not to be used in global context!

View File

@ -21,16 +21,15 @@
#ifndef STRING_EXT_H #ifndef STRING_EXT_H
#define STRING_EXT_H #define STRING_EXT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "frame.h" #include "frame.h"
#include "debug.h" #include "debug.h"
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>
#include <assert.h> #include <assert.h>
#ifdef __cplusplus
extern "C" {
#endif
/*! /*!
* Safe variant of strlen. * Safe variant of strlen.