home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / chip_20022115.iso / amiga / chiputil / nulib2.lha / nufxlib-101 / SysDefs.h < prev   
C/C++ Source or Header  |  2001-12-05  |  3KB  |  153 lines

  1. /*
  2.  * NuFX archive manipulation library
  3.  * Copyright (C) 2000 by Andy McFadden, All Rights Reserved.
  4.  * This is free software; you can redistribute it and/or modify it under the
  5.  * terms of the GNU Library General Public License, see the file COPYING.LIB.
  6.  *
  7.  * External type definitions and function prototypes.
  8.  */
  9. #ifndef __SysDefs__
  10. #define __SysDefs__
  11.  
  12. #ifdef HAVE_CONFIG_H
  13. # include <config.h>
  14. #endif
  15.  
  16. #ifdef DEBUG_VERBOSE
  17. # define DEBUG_MSGS
  18. #endif
  19.  
  20. /* these should exist everywhere */
  21. #include <stdio.h>
  22. #include <stdarg.h>
  23. #include <string.h>
  24. #ifndef _AMIGA
  25. #include <memory.h>
  26. #else
  27. #define u_char uchar
  28. #define u_long ulong
  29. #define u_int uint
  30. #define inline __inline
  31. #define mode_t ushort
  32. #define HAVE_MKTIME
  33. #define UNIX_LIKE
  34. struct utimbuf {
  35.         long actime;          /* Access time */
  36.         long modtime;         /* Modification time */
  37. };
  38. #endif
  39. #include <time.h>
  40. #include <errno.h>
  41. #include <assert.h>
  42.  
  43. /* basic Win32 stuff -- info-zip has much more complete defs */
  44. #if defined(WIN32) || defined(MSDOS)
  45. # define WINDOWS_LIKE
  46.  
  47. # ifndef HAVE_CONFIG_H
  48. #  define HAVE_FCNTL_H
  49. #  define HAVE_MALLOC_H
  50. #  define HAVE_STDLIB_H
  51. #  define HAVE_SYS_STAT_H
  52. #  undef HAVE_SYS_TIME_H
  53. #  define HAVE_SYS_TYPES_H
  54. #  undef HAVE_UNISTD_H
  55. #  undef HAVE_UTIME_H
  56. #  define HAVE_SYS_UTIME_H
  57. #  define HAVE_WINDOWS_H
  58. #  define HAVE_FDOPEN
  59. #  undef HAVE_FTRUNCATE
  60. #  define HAVE_MEMMOVE
  61. #  undef HAVE_MKSTEMP
  62. #  define HAVE_MKTIME
  63. #  define HAVE_SNPRINTF
  64. #  undef HAVE_STRCASECMP
  65. #  undef HAVE_STRNCASECMP
  66. #  define HAVE_STRERROR
  67. #  define HAVE_STRTOUL
  68. #  define HAVE_VSNPRINTF
  69. #  define SNPRINTF_DECLARED
  70. #  define VSNPRINTF_DECLARED
  71. #  define SPRINTF_RETURNS_INT
  72. #  define uchar unsigned char
  73. #  define ushort unsigned short
  74. #  define uint unsigned int
  75. #  define ulong unsigned long
  76. #  define inline /*Visual C++6.0 can't inline ".c" files*/
  77. #  define mode_t int
  78. # endif
  79.  
  80. # include <io.h>
  81. # include <direct.h>
  82. # define FOPEN_WANTS_B
  83. # define HAVE_CHSIZE
  84. # define snprintf _snprintf
  85. # define vsnprintf _vsnprintf
  86. #endif
  87.  
  88. #ifdef HAVE_MALLOC_H
  89. # include <malloc.h>
  90. #endif
  91. #ifdef HAVE_STDLIB_H
  92. # include <stdlib.h>
  93. #endif
  94. #ifdef HAVE_SYS_STAT_H
  95. # include <sys/stat.h>
  96. #endif
  97. #ifdef HAVE_SYS_TIME_H
  98. # include <sys/time.h>
  99. #endif
  100. #ifdef HAVE_SYS_TYPES_H
  101. # include <sys/types.h>
  102. #endif
  103. #ifdef HAVE_UNISTD_H
  104. # include <unistd.h>
  105. #endif
  106. #ifdef HAVE_UTIME_H
  107. # include <utime.h>
  108. #endif
  109. #ifdef HAVE_SYS_UTIME_H
  110. # include <sys/utime.h>
  111. #endif
  112.  
  113. #if defined(WINDOWS_LIKE)
  114. # ifndef F_OK
  115. #  define F_OK 02
  116. # endif
  117. #endif
  118.  
  119.  
  120. #if defined(__unix__) || defined(__unix) || defined(__BEOS__) || \
  121.     defined(__hpux) || defined(_AIX) || defined(__APPLE__)
  122. # define UNIX_LIKE        /* standardize */
  123. #endif
  124.  
  125. #if defined(UNIX_LIKE)
  126. # ifdef USE_REENTRANT_CALLS
  127. #  define _REENTRANT    /* Solaris 2.x convention */
  128. # endif
  129. #endif
  130.  
  131. #ifdef MAC
  132. # define HAS_RESOURCE_FORKS
  133. #endif
  134.  
  135. #ifdef __ORCAC__
  136. # define HAS_RESOURCE_FORKS
  137. #endif
  138.  
  139. /* __FUNCTION__ was missing from BeOS __MWERKS__, and might be gcc-only */
  140. #ifdef __GNUC__
  141. # define HAS__FUNCTION__
  142. #endif
  143.  
  144. #if defined(__sun__) && !defined(__SVR4)
  145. # include "SunOS4.h"
  146. #endif
  147.  
  148. #if defined(__linux__)
  149. # define HAS_MALLOC_CHECK_
  150. #endif
  151.  
  152. #endif /*__SysDefs__*/
  153.