Modernise use of AC_CHECK_TYPE
[openafs.git] / src / config / stds.h
index 300d833..a9d22f5 100644 (file)
@@ -51,6 +51,14 @@ pragma Off(Prototype_override_warnings);
 #define MIN_AFS_INT64 (-MAX_AFS_INT64 - 1)
 #define MAX_AFS_UINT64 0xFFFFFFFFFFFFFFFFL
 
+#ifndef HAVE_SSIZE_T
+typedef int ssize_t;
+#endif
+
+#ifndef HAVE_SIG_ATOMIC_T
+typedef int sig_atomic_t;
+#endif
+
 typedef short afs_int16;
 typedef unsigned short afs_uint16;
 #ifdef  AFS_64BIT_ENV
@@ -134,17 +142,10 @@ typedef afs_int32 afs_size_t;
 typedef afs_uint32 afs_offs_t;
 #endif /* AFS_64BIT_CLIENT */
 
-#ifdef AFS_LARGEFILE_ENV
 typedef afs_int64 afs_foff_t;
 typedef afs_uint64 afs_fsize_t;
 typedef afs_int64 afs_sfsize_t;
 #define SplitOffsetOrSize(t,h,l) SplitInt64(t,h,l)
-#else /* !AFS_LARGEFILE_ENV */
-typedef afs_int32 afs_foff_t;
-typedef afs_uint32 afs_fsize_t;
-typedef afs_int32 afs_sfsize_t;
-#define SplitOffsetOrSize(t,h,l) (h) = 0; (l) = (t);
-#endif /* !AFS_LARGEFILE_ENV */
 
 /* Maximum integer sizes.  Also what is expected by %lld, %llu in
  * afs_snprintf. */
@@ -241,7 +242,7 @@ typedef struct afs_hyper_t {        /* unsigned 64 bit integers */
 #define hadd(a,b) (hadd32(a,(b).low), (a).high += (b).high)
 #endif /* AFS_64BIT_ENV */
 
-#ifndef        KERNEL
+#if !defined(KERNEL) || defined(UKERNEL)
 #ifndef AFS_NT40_ENV
 #define max(a, b)               ((a) < (b) ? (b) : (a))
 #define min(a, b)               ((a) > (b) ? (b) : (a))
@@ -314,6 +315,9 @@ typedef struct afsUUID afsUUID;
 #elif defined(AFS_SGI_ENV) || defined(AFS_USR_SGI_ENV)
 #define static_inline static
 #define hdr_static_inline(x) x
+#elif defined(AFS_NBSD_ENV)
+#define static_inline static __inline __attribute__((always_inline))
+#define hdr_static_inline(x) static __inline __attribute__((always_inline)) x
 #else
 #define static_inline static inline
 #define hdr_static_inline(x) static inline x
@@ -333,8 +337,10 @@ hdr_static_inline(unsigned long) afs_printable_uint32_lu(afs_uint32 d) { return
 
 #if !defined(__GNUC__) || __GNUC__ < 2
 #define AFS_UNUSED
+#define AFS_ATTRIBUTE_FORMAT(style,x,y)
 #else
 #define AFS_UNUSED __attribute__((unused))
+#define AFS_ATTRIBUTE_FORMAT(style,x,y) __attribute__((format(style, x, y)))
 #endif
 
 #endif /* OPENAFS_CONFIG_AFS_STDS_H */