You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The author can be reached at nitfol@deja.com
*/
#include <stdlib.h> /* For NULL, rand, srand */
#include <time.h> /* For time() */
#include <ctype.h> /* for isspace, isgraph, etc. */
+#include <limits.h>
#include "glk.h"
#define GLK_EOF ((glsi32) -1)
#define NITFOL_MINOR 5
/* Change these next few typedefs depending on your compiler */
-#include <stdint.h>
-typedef uint8_t zbyte;
+#if UCHAR_MAX==0xff
+typedef unsigned char zbyte;
+#else
+#error "Can't find an 8-bit integer type"
+#endif
#ifdef FAST_SHORT
-typedef uint16_t zword;
-typedef uint32_t offset;
+
+#if SHRT_MAX==0x7fff
+typedef unsigned short zword;
+#elif INT_MAX==0x7fff
+typedef unsigned int zword;
+#else
+#error "Can't find a 16-bit integer type"
+#endif
+
+#if INT_MAX==0x7fffffff
+typedef unsigned int offset;
+#elif LONG_MAX==0x7fffffff
+typedef unsigned long offset;
+#else
+#error "Can't find a 32-bit integer type"
+#endif
#ifdef TWOS16SHORT
#define FAST_TWOS16SHORT
#else
#ifdef FAST_SIGNED
-typedef int32_t zword;
-typedef int32_t offset;
+#if INT_MAX==0x7fffffff
+typedef int zword;
+typedef int offset;
+#elif LONG_MAX==0x7fffffff
+typedef long zword;
+typedef long offset;
#else
-typedef uint32_t zword; /* Needs to be >= real zword */
-typedef uint32_t offset;
+#error "Can't find a 32-bit integer type"
+#endif
+
+#else
+
+#if INT_MAX==0x7fffffff
+typedef unsigned int zword;
+typedef unsigned int offset;
+#elif LONG_MAX==0x7fffffff
+typedef unsigned long zword;
+typedef unsigned long offset;
+#else
+#error "Can't find a 32-bit integer type"
+#endif
+
#endif
#endif
#include "decode.h"
#include "main.h"
-#include "io.h"
+#include "nio.h"
#include "z_io.h"
#include "no_snd.h"