v2 / vlib / v / tests / project_with_c_code_2 / modc / header.h
43 lines · 32 sloc · 766 bytes · 83385a8bf8586934b7f6fae4851b851c964f4bb4
Raw
1#ifndef CMOD_H
2#define CMOD_H
3
4struct Atype {
5 int val;
6};
7
8
9void* new_atype(int n);
10
11void handle_array(void *p, int n);
12
13void handle_array2(void *p, int n);
14
15void destroy_atype(void *p);
16
17
18// The following emulates the structure of the SDL3 header SDL_pixels.h, and the enum SDL_PixelFormat.
19// See also https://github.com/vlang/v/issues/25135 .
20#define ABC 1
21#define XYZ 1
22
23typedef enum EnumWithDuplicates {
24 UNKNOWN = 0,
25 NAME1 = 0x1u,
26 NAME2 = 0x2u,
27 NAME3 = 0x3u,
28 NAME4 = 0x4u,
29 NAME5 = 0x5u,
30 NAME6 = 0x6u,
31 #if ABC == XYZ
32 COMMON_NAME1 = NAME1,
33 COMMON_NAME2 = NAME2,
34 COMMON_NAME3 = NAME3
35 #else
36 COMMON_NAME1 = NAME4,
37 COMMON_NAME2 = NAME5,
38 COMMON_NAME3 = NAME6
39 #endif
40} EnumWithDuplicates;
41
42#endif
43
44