summaryrefslogtreecommitdiff
path: root/tests/library/testlib.c
blob: aca9450dfff74ca311eae5c8a8d4f8ff1aca971c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifdef _WIN32
#define DLLEXPORT __declspec( dllexport )
#else
#define DLLEXPORT
#endif

typedef int (*multiply_by_two_func)( int );

DLLEXPORT int multiply_by_two( int a );

int multiply_by_two( int a ) {
	return a * 2;
}

extern int DLLEXPORT seven;

int seven = 7;

typedef struct {
	int major;
	int minor;
	multiply_by_two_func func;
} module_descriptor_t;

extern DLLEXPORT module_descriptor_t mod_descr;

module_descriptor_t mod_descr = {
	1, 0, &multiply_by_two
};