aboutsummaryrefslogtreecommitdiff
path: root/include/types.h
blob: 3c0c3ff14cf051d0a2883674e129937c04c55128 (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
#ifndef SALIS_TYPES_H
#define SALIS_TYPES_H

#include <limits.h>

#define SWORD_MAX (0xffffffff)
#define SBYTE_MAX (0xff)

#if USHRT_MAX == SWORD_MAX
	typedef unsigned short sword;
#elif UINT_MAX == SWORD_MAX
	typedef unsigned int sword;
#elif ULONG_MAX == SWORD_MAX
	typedef unsigned long sword;
#elif
	#error "Cannot define 32 bit unsigned int (sword)"
#endif

#if UCHAR_MAX == SBYTE_MAX
	typedef unsigned char sbyte;
#elif
	#error "Cannot define 8 bit unsigned int (sbyte)"
#endif

typedef int sbool;

#define SFALSE (0)
#define STRUE  (1)
#define SNULL  ((sword)-1)

#endif