Imported Upstream version 1.1.11
[platform/upstream/cdrkit.git] / include / standard.h
1 /*
2  * This file has been modified for the cdrkit suite.
3  *
4  * The behaviour and appearence of the program code below can differ to a major
5  * extent from the version distributed by the original author(s).
6  *
7  * For details, see Changelog file distributed with the cdrkit package. If you
8  * received this file from another source then ask the distributing person for
9  * a log of modifications.
10  *
11  */
12
13 /* @(#)standard.h       1.31 03/08/23 Copyright 1985 J. Schilling */
14 /*
15  *      standard definitions
16  *
17  *      This file should be included past:
18  *
19  *      mconfig.h / config.h
20  *      stdio.h
21  *      stdlib.h        (better use stdxlib.h)
22  *      unistd.h        (better use unixstd.h) needed LARGEFILE support
23  *
24  *      If you need stdio.h, you must include it before standard.h
25  *
26  *      Copyright (c) 1985 J. Schilling
27  */
28 /*
29  * This program is free software; you can redistribute it and/or modify
30  * it under the terms of the GNU General Public License version 2
31  * as published by the Free Software Foundation.
32  *
33  * This program is distributed in the hope that it will be useful,
34  * but WITHOUT ANY WARRANTY; without even the implied warranty of
35  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
36  * GNU General Public License for more details.
37  *
38  * You should have received a copy of the GNU General Public License along with
39  * this program; see the file COPYING.  If not, write to the Free Software
40  * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41  */
42
43 #ifndef _STANDARD_H
44 #define _STANDARD_H
45
46 #ifndef _MCONFIG_H
47 #include <mconfig.h>
48 #endif
49 #ifndef _PROTOTYP_H
50 #include <prototyp.h>
51 #endif
52
53 #ifdef  M68000
54 #       ifndef  tos
55 #               define  JOS     1
56 #       endif
57 #endif
58
59 /*
60  *      fundamental constants
61  */
62 #ifndef NULL
63 #       define  NULL            0
64 #endif
65 #ifndef TRUE
66 #       define  TRUE            1
67 #       define  FALSE           0
68 #endif
69
70 /*
71  *      Program exit codes
72  */
73 #define EX_BAD                  (-1)
74
75 /*
76  *      standard storage class definitions
77  */
78 #define GLOBAL  extern
79 #define IMPORT  extern
80 #define EXPORT
81 #define INTERN  static
82 #define LOCAL   static
83 #define FAST    register
84
85 #ifndef PROTOTYPES
86 #       ifndef  const
87 #               define  const
88 #       endif
89 #       ifndef  signed
90 #               define  signed
91 #       endif
92 #       ifndef  volatile
93 #               define  volatile
94 #       endif
95 #endif  /* PROTOTYPES */
96
97 /*
98  *      standard type definitions
99  *
100  *      The hidden Schily BOOL definition is used in case we need to deal
101  *      with other BOOL defines on systems we like to port to.
102  */
103 typedef int __SBOOL;
104 typedef int BOOL;
105 #ifdef  JOS
106 #       ifndef  __GNUC__
107 #       define  NO_VOID
108 #       endif
109 #endif
110 #ifdef  NO_VOID
111         typedef int     VOID;
112 #       ifndef  lint
113                 typedef int void;
114 #       endif
115 #else
116         typedef void    VOID;
117 #endif
118
119 #if     defined(_INCL_SYS_TYPES_H) || defined(off_t)
120 #       ifndef  FOUND_OFF_T
121 #       define  FOUND_OFF_T
122 #       endif
123 #endif
124 #if     defined(_INCL_SYS_TYPES_H) || defined(size_t)
125 #       ifndef  FOUND_SIZE_T
126 #       define  FOUND_SIZE_T
127 #       endif
128 #endif
129
130 #ifdef  __never_def__
131 /*
132  * It turns out that we cannot use the folloginw definition because there are
133  * some platforms that do not behave application friendly. These are mainly
134  * BSD-4.4 based systems (which #undef a definition when size_t is available.
135  * We actually removed this code because of a problem with QNX Neutrino.
136  * For this reason, it is important not to include <sys/types.h> directly but
137  * via the Schily SING include files so we know whether it has been included
138  * before we come here.
139  */
140 #if     defined(_SIZE_T)        || defined(_T_SIZE_)    || defined(_T_SIZE) || \
141         defined(__SIZE_T)       || defined(_SIZE_T_)    || \
142         defined(_GCC_SIZE_T)    || defined(_SIZET_)     || \
143         defined(__sys_stdtypes_h) || defined(___int_size_t_h) || defined(size_t)
144
145 #ifndef FOUND_SIZE_T
146 #       define  FOUND_SIZE_T    /* We already included a size_t definition */
147 #endif
148 #endif
149 #endif  /* __never_def__ */
150
151 #if defined(_JOS) || defined(JOS)
152 #       ifndef  _SCHILY_H
153 #       include <schily.h>
154 #       endif
155
156 #       ifndef  _JOS_DEFS_H
157 #       include <jos_defs.h>
158 #       endif
159
160 #       ifndef  _JOS_IO_H
161 #       include <jos_io.h>
162 #       endif
163 #endif
164
165 #endif  /* _STANDARD_H */