| 1 |
#pragma once |
| 2 |
|
| 3 |
#ifdef __cplusplus |
| 4 |
extern "C" { |
| 5 |
#endif |
| 6 |
|
| 7 |
#if defined _WIN32 || defined __CYGWIN__ |
| 8 |
#if defined BUILDING_ADDER |
| 9 |
#define DLL_PUBLIC __declspec(dllexport) |
| 10 |
#else |
| 11 |
#define DLL_PUBLIC __declspec(dllimport) |
| 12 |
#endif |
| 13 |
#else |
| 14 |
#if defined __GNUC__ |
| 15 |
#if defined BUILDING_ADDER |
| 16 |
#define DLL_PUBLIC __attribute__ ((visibility("default"))) |
| 17 |
#else |
| 18 |
#define DLL_PUBLIC |
| 19 |
#endif |
| 20 |
#else |
| 21 |
#pragma message ("Compiler does not support symbol visibility.") |
| 22 |
#define DLL_PUBLIC |
| 23 |
#endif |
| 24 |
#endif |
| 25 |
|
| 26 |
typedef struct _Adder adder; |
| 27 |
|
| 28 |
DLL_PUBLIC extern adder* adder_create(int number); |
| 29 |
DLL_PUBLIC extern int adder_add(adder *a, int number); |
| 30 |
DLL_PUBLIC extern void adder_destroy(adder*); |
| 31 |
|
| 32 |
#ifdef __cplusplus |
| 33 |
} |
| 34 |
#endif |