Guard against multiple typedefs of KvpFrame and KvpValue.

It's legal for C11, but not before. No need to gratuitously force an
upgrade.
This commit is contained in:
John Ralls 2015-07-09 09:15:15 -07:00
parent d3e70217cd
commit b9d6b8423f
4 changed files with 15 additions and 1 deletions

View File

@ -16,7 +16,10 @@ extern "C"
#include <io-gncxml-gen.h> #include <io-gncxml-gen.h>
#include <sixtp.h> #include <sixtp.h>
#ifndef __KVP_FRAME
typedef struct KvpFrameImpl KvpFrame; typedef struct KvpFrameImpl KvpFrame;
#define __KVP_FRAME
#endif
void write_dom_node_to_file(xmlNodePtr node, int fd); void write_dom_node_to_file(xmlNodePtr node, int fd);

View File

@ -17,8 +17,14 @@ extern "C"
#include "gnc-pricedb.h" #include "gnc-pricedb.h"
#include "SchedXaction.h" #include "SchedXaction.h"
#ifndef __KVP_VALUE
typedef struct KvpValueImpl KvpValue; typedef struct KvpValueImpl KvpValue;
#define __KVP_VALUE
#endif
#ifndef __KVP_FRAME
typedef struct KvpFrameImpl KvpFrame; typedef struct KvpFrameImpl KvpFrame;
#define __KVP_FRAME
#endif
Timespec* get_random_timespec(void); Timespec* get_random_timespec(void);
void random_timespec_zero_nsec (gboolean zero_nsec); void random_timespec_zero_nsec (gboolean zero_nsec);
void random_timespec_usec_resolution (gboolean usec_resolution); void random_timespec_usec_resolution (gboolean usec_resolution);

View File

@ -49,7 +49,10 @@ extern "C"
#ifndef SWIG #ifndef SWIG
typedef struct _QofBookClass QofBookClass; typedef struct _QofBookClass QofBookClass;
#ifndef __KVP_VALUE
typedef struct KvpValueImpl KvpValue; typedef struct KvpValueImpl KvpValue;
#define __KVP_VALUE
#endif
#include "qofid.h" #include "qofid.h"
#include "qofinstance.h" #include "qofinstance.h"

View File

@ -60,8 +60,10 @@ typedef struct _QofBook QofBook;
(G_TYPE_CHECK_CLASS_TYPE ((k), QOF_TYPE_INSTANCE)) (G_TYPE_CHECK_CLASS_TYPE ((k), QOF_TYPE_INSTANCE))
#define QOF_INSTANCE_GET_CLASS(o) \ #define QOF_INSTANCE_GET_CLASS(o) \
(G_TYPE_INSTANCE_GET_CLASS ((o), QOF_TYPE_INSTANCE, QofInstanceClass)) (G_TYPE_INSTANCE_GET_CLASS ((o), QOF_TYPE_INSTANCE, QofInstanceClass))
#ifndef __KVP_FRAME
typedef struct KvpFrameImpl KvpFrame; typedef struct KvpFrameImpl KvpFrame;
#define __KVP_FRAME
#endif
struct QofInstance_s struct QofInstance_s
{ {