-
Notifications
You must be signed in to change notification settings - Fork 1
/
global.h
102 lines (90 loc) · 2.68 KB
/
global.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* COPS (c) 1995 - 2003 Sven & Wilfried Behne
* 2004 F.Naumann & O.Skancke
*
* A XCONTROL compatible CPX manager.
*
* This file is part of COPS.
*
* COPS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* COPS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XaAES; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
# ifndef _global_h
# define _global_h
# include <sys/types.h>
# include <mint/mintbind.h>
# ifndef _cdecl
# define _cdecl __CDECL
# endif
# define str(x) _stringify (x)
# define _stringify(x) #x
#define min(a,b) ((a) < (b) ? (a) : (b))
#define max(a,b) ((a) > (b) ? (a) : (b))
#define between(x,a,b) ((x >= a) && (x <= b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#if 0
#define DEBUG(x) printf x, fflush(stdout)
#undef DEBUG
#include <mint/arch/nf_ops.h>
#define DEBUG(x) nf_debugprintf x
#if defined(__GNUC__)
#define DEBUG_FMT "%s"
#define DEBUG_ARGS __FUNCTION__
#else
#define DEBUG_FMT "%s:%d"
#define DEBUG_ARGS __FILE__, __LINE__
#endif
#else
#define DEBUG(x)
#endif
/* XXX add to mintlib somewhere under include/mint */
#ifndef __XATTR
#define __XATTR
struct xattr
{
unsigned short st_mode;
long st_ino; /* must be 32 bits */
unsigned short st_dev; /* must be 16 bits */
short st_rdev; /* not supported by the kernel */
unsigned short st_nlink;
unsigned short st_uid; /* must be 16 bits */
unsigned short st_gid; /* must be 16 bits */
long st_size;
long st_blksize;
long st_blocks;
unsigned long st_mtime;
unsigned long st_atime;
unsigned long st_ctime;
short st_attr;
short res1; /* reserved for future kernel use */
long res2[2];
};
#endif
#ifndef BOOLEAN
#define BOOLEAN int
#endif
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
#ifndef __GNUC__
#define __builtin_unreachable()
#endif
#if defined(BROKEN_GEMLIB)
#define wind_get_int(a,b,c) wind_get(a,b,c,NULL,NULL,NULL)
#define wind_set_int(a,b,c) wind_set(a,b,c,0,0,0)
#define form_dial_grect(a,b,c) form_dial(a, (b)->g_x, (b)->g_y, (b)->g_w, (b)->g_h, (c)->g_x, (c)->g_y, (c)->g_w, (c)->g_h)
#define objc_change_grect(a,b,c,d,e,f) objc_change(a,b,c,(d)->g_x, (d)->g_y, (d)->g_w, (d)->g_h, e,f)
#endif
# endif /* _global_h */