#ifndef RC_EXPORT_H1#define RC_EXPORT_H23/* These macros control how callbacks and public functions are defined */45/* RC_SHARED should be defined when building rcheevos as a shared library (e.g. dll/dylib/so). External code should not define this macro. */6/* RC_STATIC should be defined when building rcheevos as a static library. External code should also define this macro. */7/* RC_IMPORT should be defined for external code using rcheevos as a shared library. */89/* For compatibility, if none of these three macros are defined, then the build is assumed to be RC_STATIC */1011#if !defined(RC_SHARED) && !defined(RC_STATIC) && !defined(RC_IMPORT)12#define RC_STATIC13#endif1415#if (defined(RC_SHARED) && defined(RC_STATIC)) || (defined(RC_SHARED) && defined(RC_IMPORT)) || (defined(RC_STATIC) && defined(RC_IMPORT))16#error RC_SHARED, RC_STATIC, and RC_IMPORT are mutually exclusive17#endif1819/* RC_BEGIN_C_DECLS and RC_END_C_DECLS should be used for all headers, to enforce C linkage and the C calling convention */20/* RC_BEGIN_C_DECLS should be placed after #include's and before header declarations */21/* RC_END_C_DECLS should be placed after header declarations */2223/* example usage24*25* #ifndef RC_HEADER_H26* #define RC_HEADER_H27*28* #include <stdint.h>29*30* RC_BEGIN_C_DECLS31*32* uint8_t rc_function(void);33*34* RC_END_C_DECLS35*36* #endif37*/3839#ifdef __cplusplus40#define RC_BEGIN_C_DECLS extern "C" {41#define RC_END_C_DECLS }42#else43#define RC_BEGIN_C_DECLS44#define RC_END_C_DECLS45#endif4647/* RC_CCONV should be used for public functions and callbacks, to enforce the cdecl calling convention, if applicable */48/* RC_CCONV should be placed after the return type, and between the ( and * for callbacks */4950/* example usage */51/* void RC_CCONV rc_function(void) */52/* void (RC_CCONV *rc_callback)(void) */5354#if defined(_WIN32)55/* Windows compilers will ignore __cdecl when not applicable */56#define RC_CCONV __cdecl57#elif defined(__GNUC__) && defined(__i386__)58/* GNU C compilers will warn if cdecl is defined on an unsupported platform */59#define RC_CCONV __attribute__((cdecl))60#else61#define RC_CCONV62#endif6364/* RC_EXPORT should be used for public functions */65/* RC_EXPORT will provide necessary hints for shared library usage, if applicable */66/* RC_EXPORT should be placed before the return type */6768/* example usage */69/* RC_EXPORT void rc_function(void) */7071#ifdef RC_SHARED72#if defined(_WIN32)73#define RC_EXPORT __declspec(dllexport)74#elif defined(__GNUC__) && __GNUC__ >= 475#define RC_EXPORT __attribute__((visibility("default")))76#else77#define RC_EXPORT78#endif79#endif8081#ifdef RC_IMPORT82#if defined(_WIN32)83#define RC_EXPORT __declspec(dllimport)84#elif defined(__GNUC__) && __GNUC__ >= 485#define RC_EXPORT __attribute__((visibility("default")))86#else87#define RC_EXPORT88#endif89#endif9091#ifdef RC_STATIC92#if defined(__GNUC__) && __GNUC__ >= 493#define RC_EXPORT __attribute__((visibility("default")))94#else95#define RC_EXPORT96#endif97#endif9899#endif /* RC_EXPORT_H */100101102