forked from stepcode/stepcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.h
More file actions
150 lines (129 loc) · 3.35 KB
/
basic.h
File metadata and controls
150 lines (129 loc) · 3.35 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#ifndef BASIC_H
#define BASIC_H
/*
* This work was supported by the United States Government, and is
* not subject to copyright.
*
* $Log: basic.h,v $
* Revision 1.8 1997/10/22 16:06:28 sauderd
* Added a help for the Centerline C compiler. It doesn't define __STDC__ but
* it does understand prototypes (which is required to build the express toolkit)
* The standard prototypes aren't turned on unless __STDC__ is turned on. I
* changed it so that it is turned on for Centerline.
*
* Revision 1.7 1996/12/18 20:50:29 dar
* updated for C++ compatibility
*
* Revision 1.6 1994/05/11 19:51:39 libes
* numerous fixes
*
* Revision 1.5 1993/10/15 18:49:23 libes
* CADDETC certified
*
* Revision 1.4 1993/03/22 18:07:15 libes
* deleted MIN/MAX. Not used, and wrong to boot.
*
* Revision 1.3 1993/01/19 22:45:07 libes
* *** empty log message ***
*
* Revision 1.2 1992/08/18 17:15:40 libes
* rm'd extraneous error messages
*
* Revision 1.1 1992/05/28 03:56:02 libes
* Initial revision
*
* Revision 1.3 1992/02/12 07:06:15 libes
* do sub/supertype
*
* Revision 1.2 1992/02/09 00:47:45 libes
* does ref/use correctly
*
* Revision 1.1 1992/02/05 08:40:30 libes
* Initial revision
*
* Revision 1.1 1992/01/22 02:17:49 libes
* Initial revision
*
* Revision 1.5 1992/01/15 19:49:04 shepherd
* Commented out text after #else and #endif.
*
* Revision 1.2 91/01/14 13:34:14 silver
* moeimodified to remove ANSI C compiler warning messages from the
* preprocessor directives.
*
* Revision 1.1 91/01/09 15:25:16 laurila
* Initial revision
*
* Revision 1.3 90/09/25 10:01:36 clark
* Beta checkin at SCRA
*
* Revision 1.3 90/09/25 10:01:36 clark
* Put wrapper around static_inline stuff,
* checking for previous definition.
*
* Revision 1.2 90/09/04 15:05:51 clark
* BPR 2.1 alpha
*
* Revision 1.1 90/06/11 17:04:56 clark
* Initial revision
*
*/
#include <sc_cf.h>
#include <sc_export.h>
#include <stdio.h>
/******************************/
/* type Boolean and constants */
/******************************/
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include <sc_stdbool.h>
#endif
/************************/
/* Generic pointer type */
/************************/
#ifdef __STDC__
typedef void * Generic;
#else
typedef char * Generic;
#endif /* */
/* other handy macros */
#define streq(x,y) (!strcmp((x),(y)))
/**************************/
/* function pointer types */
/**************************/
typedef void ( *voidFuncptr )();
typedef int ( *intFuncptr )();
/******************************/
/* deal with inline functions */
/******************************/
#if !defined(static_inline)
#if (!defined(__GNUC__) && !defined(__MSVC__)) || defined(__STRICT_ANSI)
#define static_inline
#undef supports_inline_functions
#else
#define static_inline static __inline
#define supports_inline_functions 1L
#endif /* */
#endif /* !defined(static_inline) */
/* allow same declarations to suffice for both Standard and Classic C */
/* ... at least in header files ... */
#ifndef CONST
# ifdef __STDC__
# define CONST const
# else
# define CONST
# endif
#endif
#ifndef PROTO
# ifdef __STDC__
# define PROTO(x) x
# else
# if defined(__CLCC__) || defined(__MSVC__) || defined(__BORLAND__)
# define PROTO(x) x
#else
# define PROTO(x) ()
# endif
# endif
#endif
#endif /* */