From: Vincent Pit Date: Mon, 21 Dec 2015 14:30:58 +0000 (+0100) Subject: C++ compilers are officially not supported X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=ae9dac2afcda73d39905af2af302aada956ea92d;p=perl%2Fmodules%2FVPIT-XSHelpers.git C++ compilers are officially not supported --- diff --git a/xsh/caps.h b/xsh/caps.h index 4559524..6c0b944 100644 --- a/xsh/caps.h +++ b/xsh/caps.h @@ -1,6 +1,10 @@ #ifndef XSH_CAPS_H #define XSH_CAPS_H 1 +#ifdef __cplusplus +# error C++ compilers are not supported +#endif + #define XSH_HAS_PERL(R, V, S) (PERL_REVISION > (R) || (PERL_REVISION == (R) && (PERL_VERSION > (V) || (PERL_VERSION == (V) && (PERL_SUBVERSION >= (S)))))) #define XSH_HAS_PERL_BRANCH(R, V, S) (PERL_REVISION == (R) && PERL_VERSION == (V) && PERL_SUBVERSION >= (S)) diff --git a/xsh/mem.h b/xsh/mem.h index 9b59a71..e1b90b3 100644 --- a/xsh/mem.h +++ b/xsh/mem.h @@ -1,7 +1,7 @@ #ifndef XSH_MEM_H #define XSH_MEM_H 1 -#include "util.h" /* VOID2(), XSH_ASSERT() */ +#include "util.h" /* XSH_ASSERT() */ #ifdef DEBUGGING # ifdef Poison @@ -72,13 +72,13 @@ static void *xsh_shared_alloc(pPMS_ size_t size) { #endif /* !XSH_HAS_POISON_NEW */ -#define XSH_SHARED_ALLOC(D, N, T) ((D) = VOID2(T *, xsh_shared_alloc((N) * sizeof(T)))) +#define XSH_SHARED_ALLOC(D, N, T) ((D) = xsh_shared_alloc((N) * sizeof(T))) /* ... xsh_shared_calloc() ................................................. */ #define xsh_shared_calloc(C, S) PerlMemShared_calloc((C), (S)) -#define XSH_SHARED_CALLOC(D, N, T) ((D) = VOID2(T *, xsh_shared_calloc((N), sizeof(T)))) +#define XSH_SHARED_CALLOC(D, N, T) ((D) = xsh_shared_calloc((N), sizeof(T))) /* ... xsh_shared_free() ................................................... */ @@ -136,7 +136,7 @@ static void *xsh_shared_realloc(pPMS_ void *p, size_t old_size, size_t new_size) #endif /* !XSH_HAS_POISON_NEW || !XSH_HAS_POISON_FREE */ -#define XSH_SHARED_REALLOC(D, OL, NL, T) ((D) = VOID2(T *, xsh_shared_realloc((D), (OL) * sizeof(T), (NL) * sizeof(T)))) +#define XSH_SHARED_REALLOC(D, OL, NL, T) ((D) = xsh_shared_realloc((D), (OL) * sizeof(T), (NL) * sizeof(T))) /* ... xsh_shared_recalloc() ............................................... */ @@ -158,7 +158,7 @@ static void *xsh_shared_recalloc(pPMS_ void *p, size_t old_size, size_t new_size return q; } -#define XSH_SHARED_RECALLOC(D, OL, NL, T) ((D) = VOID2(T *, xsh_shared_recalloc((D), (OL) * sizeof(T), (NL) * sizeof(T)))) +#define XSH_SHARED_RECALLOC(D, OL, NL, T) ((D) = xsh_shared_recalloc((D), (OL) * sizeof(T), (NL) * sizeof(T))) /* --- Interpreter-local memory -------------------------------------------- */ diff --git a/xsh/util.h b/xsh/util.h index c4be169..599dbf4 100644 --- a/xsh/util.h +++ b/xsh/util.h @@ -23,13 +23,6 @@ # define XSH_ASSERT(C) #endif -#undef VOID2 -#ifdef __cplusplus -# define VOID2(T, P) static_cast(P) -#else -# define VOID2(T, P) (P) -#endif - #ifndef STMT_START # define STMT_START do #endif