File: struct-7.c

package info (click to toggle)
dateutils 0.4.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,228 kB
  • sloc: ansic: 22,598; makefile: 1,771; yacc: 202; sh: 168; lex: 108
file content (37 lines) | stat: -rw-r--r-- 746 bytes parent folder | download | duplicates (6)
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
#if defined HAVE_CONFIG_H
# include "config.h"
#endif	/* HAVE_CONFIG_H */
#include <stdio.h>
#include "dt-core.h"

int
main(void)
{
	int res = 0;
#if !defined __uint128_t_defined
	typedef struct {
		uint64_t l;
		uint64_t h;
	} uint128_t;
#define __uint128_t_defined
#endif	/* !uint128_t */

#define CHECK_SIZE(x, y)						\
	if (sizeof(x) != sizeof(y)) {					\
		fprintf(						\
			stderr,						\
			"sizeof(" #x ") -> %zu\t"			\
			"sizeof(" #y ") -> %zu\n",			\
			sizeof(x), sizeof(y));				\
		res = 1;						\
	}

	CHECK_SIZE(struct dt_dt_s, uint128_t);
	CHECK_SIZE(struct dt_d_s, uint64_t);
	CHECK_SIZE(struct dt_t_s, uint64_t);
	CHECK_SIZE(dt_ymdhms_t, uint64_t);
	CHECK_SIZE(dt_sexy_t, uint64_t);
	return res;
}

/* struct-7.c ends here */