Use afsd code in libuafs
[openafs.git] / src / config / stds.h
index f1ff418..3c9dc78 100644 (file)
@@ -134,17 +134,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 +234,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))
@@ -284,7 +277,7 @@ typedef struct afsUUID afsUUID;
 #ifdef AFS_NT40_ENV
 # define AFS_INT64_FMT "I64d"
 # define AFS_UINT64_FMT "I64u"
-# define AFS_PTR_FMT   "Ip"
+# define AFS_PTR_FMT   "p"
 # define AFS_SIZET_FMT "Iu"
 #else
 # define AFS_INT64_FMT "lld"
@@ -304,8 +297,10 @@ typedef struct afsUUID afsUUID;
 #define static_inline __inline static
 #define hdr_static_inline(x) __inline static x
 #elif defined(AFS_HPUX_ENV) || defined(AFS_USR_HPUX_ENV)
-#define static_inline static __inline
-#define hdr_static_inline(x) static __inline x
+/* The HPUX compiler can segfault on 'static __inline', so fall back to
+ * just 'static' so we can at least compile */
+#define static_inline static
+#define hdr_static_inline(x) static x
 #elif defined(AFS_AIX_ENV) || defined(AFS_USR_AIX_ENV)
 #define static_inline static
 #define hdr_static_inline(x) static x
@@ -331,8 +326,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 */