From f8cd615bc4324386d173ad3615ab23b58da34752 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Mon, 11 Feb 2019 13:07:24 +0100 Subject: [PATCH] lib: remove unnamed struct in qobj for C++ Signed-off-by: David Lamparter --- lib/qobj.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/qobj.h b/lib/qobj.h index b701eeec5f..a109bf4a73 100644 --- a/lib/qobj.h +++ b/lib/qobj.h @@ -28,11 +28,17 @@ * this is intentional to prevent the struct from growing beyond the allocated * space. */ +#ifndef __cplusplus #define RESERVED_SPACE_STRUCT(name, fieldname, size) \ struct { \ struct name fieldname; \ char padding##fieldname[size - sizeof(struct name)]; \ }; +#else +#define RESERVED_SPACE_STRUCT(name, fieldname, size) \ + struct name fieldname; \ + char padding##fieldname[size - sizeof(struct name)]; +#endif /* don't need struct definitions for these here. code actually using * these needs to define the struct *before* including this header. -- 2.39.5