#ifndef MGCLIENT_MGCOMMON_H
#define MGCLIENT_MGCOMMON_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef MGCLIENT_ON_APPLE
#include "apple/mgcommon.h"
#endif
#ifdef MGCLIENT_ON_LINUX
#include "linux/mgcommon.h"
#endif
#ifdef MGCLIENT_ON_WINDOWS
#include "windows/mgcommon.h"
#endif
#define MG_RETURN_IF_FAILED(expression) \
do { \
int status = (expression); \
if (status != 0) { \
return status; \
} \
} while (0)
#ifdef NDEBUG
#define DB_ACTIVE 0
#else
#define DB_ACTIVE 1
#endif #define DB_LOG(x) \
do { \
if (DB_ACTIVE) fprintf(stderr, x); \
} while (0)
#ifdef MGCLIENT_ON_APPLE
#define MG_ATTRIBUTE_WEAK __attribute__((weak))
#else
#define MG_ATTRIBUTE_WEAK
#endif
#ifdef __cplusplus
}
#endif
#endif