This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dr_types.c
50 lines (40 loc) · 1.68 KB
/
dr_types.c
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
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2018 Drew Richardson <[email protected]>
#include <stdio.h>
#include "dr_util.h"
#include "dr_config.h"
// Temporary definitions to satisfy dr_types_common.h usages of dr_types.h definitions
typedef char dr_event_t;
typedef char dr_overlapped_t;
typedef char dr_sockaddr_t;
#include "dr_types_impl.h"
#if defined(DR_HAS___ALIGNOF)
#define ALIGN(TYPE) __alignof(TYPE)
#elif defined(DR_HAS___ALIGNOF__)
#define ALIGN(TYPE) __alignof__(TYPE)
#else
#error missing alignof
#endif
int main(void) {
static const char buf[] = {
'\n',
't','y','p','e','d','e','f',' ','s','t','r','u','c','t',' ','{',' ',
DR_XINTXX2(ALIGN(dr_event_impl_t), 1),
' ','_','_','p','r','i','v','a','t','e','[',
DR_HEXSTR((sizeof(dr_event_impl_t) + ALIGN(dr_event_impl_t) - 1)/ALIGN(dr_event_impl_t)),
']',';',' ','}',' ','d','r','_','e','v','e','n','t','_','t',';','\n',
't','y','p','e','d','e','f',' ','s','t','r','u','c','t',' ','{',' ',
DR_XINTXX2(ALIGN(dr_overlapped_impl_t), 1),
' ','_','_','p','r','i','v','a','t','e','[',
DR_HEXSTR((sizeof(dr_overlapped_impl_t) + ALIGN(dr_overlapped_impl_t) - 1)/ALIGN(dr_overlapped_impl_t)),
']',';',' ','}',' ','d','r','_','o','v','e','r','l','a','p','p','e','d','_','t',';','\n',
't','y','p','e','d','e','f',' ','s','t','r','u','c','t',' ','{',' ',
DR_XINTXX2(ALIGN(dr_sockaddr_impl_t), 1),
' ','_','_','p','r','i','v','a','t','e','[',
DR_HEXSTR((sizeof(dr_sockaddr_impl_t) + ALIGN(dr_sockaddr_impl_t) - 1)/ALIGN(dr_sockaddr_impl_t)),
']',';',' ','}',' ','d','r','_','s','o','c','k','a','d','d','r','_','t',';','\n',
'\n','\0',
};
printf("%s", buf);
return 0;
}