summaryrefslogtreecommitdiffhomepage
path: root/src/internal/w32lib_impl.h
blob: 10336525249706d9e76d549304f1e70818a3f362 (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
30
31
32
33
34
35
36
37
#include <stdint.h>

struct w32lib_guid {
	uint32_t	data1;
	uint16_t	data2;
	uint16_t	data3;
	unsigned char	data4[8];
};

struct w32lib_pkey {
	struct w32lib_guid	guid;
	uint32_t		propid;
};

#define W32LIB_QUOTE(name)                 #name

#define W32LIB_HIDDEN_JOIN(prefix,name)    __ ## prefix ## _ ## name
#define W32LIB_NAMESPACE_JOIN(prefix,name) w32lib ## _ ## prefix ## _ ## name
#define W32LIB_LEGACY_JOIN(prefix,name)    prefix ## _ ## name

#define W32LIB_HIDDEN_NAME(prefix,name)    W32LIB_HIDDEN_JOIN(prefix,name)
#define W32LIB_NAMESPACE_NAME(prefix,name) W32LIB_NAMESPACE_JOIN(prefix,name)
#define W32LIB_LEGACY_NAME(prefix,name)    W32LIB_LEGACY_JOIN(prefix,name)

/************************************************************************************************/
#define W32LIB_GUID(hname,mname,lname,u32,u16a,u16b,u8a,u8b,u8c,u8d,u8e,u8f,u8g,u8h)             \
static const struct w32lib_guid hname = {u32,u16a,u16b,{u8a,u8b,u8c,u8d,u8e,u8f,u8g,u8h}};       \
extern const struct w32lib_guid mname __attribute((weak,alias(W32LIB_QUOTE(hname))));            \
extern const struct w32lib_guid lname __attribute((weak,alias(W32LIB_QUOTE(hname))));            \
/************************************************************************************************/

/************************************************************************************************/
#define W32LIB_PKEY(hname,mname,lname,u32,u16a,u16b,u8a,u8b,u8c,u8d,u8e,u8f,u8g,u8h,id)          \
static const struct w32lib_pkey hname = {{u32,u16a,u16b,{u8a,u8b,u8c,u8d,u8e,u8f,u8g,u8h}},id};  \
extern const struct w32lib_pkey mname __attribute((weak,alias(W32LIB_QUOTE(hname))));            \
extern const struct w32lib_pkey lname __attribute((weak,alias(W32LIB_QUOTE(hname))));            \
/************************************************************************************************/