From 32835873f0bb34d440a07b2339fbb3e9f9e37faa Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 13 Dec 2019 08:19:39 +0100 Subject: [PATCH 1/2] Update m3d.h Fix review warning. --- code/M3D/m3d.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/M3D/m3d.h b/code/M3D/m3d.h index 25baacc24..5d78374f0 100644 --- a/code/M3D/m3d.h +++ b/code/M3D/m3d.h @@ -87,7 +87,11 @@ typedef uint16_t M3D_INDEX; #ifndef _MSC_VER #define _inline __inline__ #define _pack __attribute__((packed)) -#define _unused __attribute__((unused)) +# ifdef __cplusplus // only for c++ code +# define _unused __attribute__((unused)) +# else // or c code just use void +# define _unused (void) +# endif #else #define _inline #define _pack From 8be1060ec4eed9b498109e5cb922215e63c20f2f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 13 Dec 2019 08:21:45 +0100 Subject: [PATCH 2/2] Update m3d.h Fix vs-defines for unused define as well. --- code/M3D/m3d.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/M3D/m3d.h b/code/M3D/m3d.h index 5d78374f0..a36cc9613 100644 --- a/code/M3D/m3d.h +++ b/code/M3D/m3d.h @@ -95,7 +95,11 @@ typedef uint16_t M3D_INDEX; #else #define _inline #define _pack -#define _unused __pragma(warning(suppress:4100)) +# ifdef __cplusplus // only for c++ code +# define _unused __pragma(warning(suppress:4100)) +# else // or c code just use void +# define _unused (void) +# endif // ___cplusplus #endif #ifndef __cplusplus #define _register register