aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-init.h
blob: 5add7b4a8001f74070c3e9cc234e0d109c6b0ef9 (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
/* Function definitions that are used by multiple tests.  */

#define INIT_CHAR(TYPE)			\
  void init##TYPE (TYPE *p, int i)	\
   { p->c = (char)i; }

INIT_CHAR(Ucs)
INIT_CHAR(Uci)
INIT_CHAR(Ucl)
INIT_CHAR(Ucll)


#define INIT_SHORT(TYPE)		\
  void init##TYPE (TYPE *p, int i)	\
   { p->s = (short)i; }

INIT_SHORT(Usi)
INIT_SHORT(Usl)
INIT_SHORT(Usll)


#define INIT_INT(TYPE)			\
  void init##TYPE (TYPE *p, int i)	\
   { p->i = i; }

INIT_INT(Uil)
INIT_INT(Uill)


#define INIT_LONG(TYPE)			\
  void init##TYPE (TYPE *p, int i)	\
   { p->l = (long)i; }

INIT_LONG(Ulll)