public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Subject: [PATCH 09/13] xfsprogs: move __u*/__s* typedefs to per-port headers
Date: Fri,  3 Jul 2015 12:12:17 +0200	[thread overview]
Message-ID: <1435918341-10128-10-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1435918341-10128-1-git-send-email-hch@lst.de>

Currently we have to install the autoconf-generated platform_defs.h
to get the defintions for these.  But they are clearly a feature
of Linux vs non-Linux platforms so move them to the per-port headers
instead.

Note: in the long run it might be a good idea to just the standard
uint*_t/int*_t types instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 configure.ac               |  1 -
 include/darwin.h           |  9 +++++++++
 include/freebsd.h          |  9 +++++++++
 include/gnukfreebsd.h      |  9 +++++++++
 include/irix.h             |  9 +++++++++
 include/linux.h            |  1 +
 include/platform_defs.h.in | 14 --------------
 m4/package_types.m4        | 13 -------------
 8 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/configure.ac b/configure.ac
index fe991cc..d6d1adc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,7 +116,6 @@ AC_HAVE_READDIR
 
 AC_CHECK_SIZEOF([long])
 AC_CHECK_SIZEOF([char *])
-AC_TYPE_U32
 AC_TYPE_UMODE_T
 AC_MANUAL_FORMAT
 
diff --git a/include/darwin.h b/include/darwin.h
index 30f0052..abdf4e3 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -109,6 +109,15 @@ static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)
 	memcpy(dst, src, sizeof(uuid_t));
 }
 
+typedef unsigned char		__u8;
+typedef signed char		__s8;
+typedef unsigned short		__u16;
+typedef signed short		__s16;
+typedef unsigned int		__u32;
+typedef signed int		__s32;
+typedef unsigned long long int	__u64;
+typedef signed long long int	__s64;
+
 #define __int8_t	int8_t
 #define __int16_t	int16_t
 #define __int32_t	int32_t
diff --git a/include/freebsd.h b/include/freebsd.h
index e59b1e8..902b940 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -53,6 +53,15 @@ typedef __uint64_t	xfs_ino_t;
 typedef __uint32_t	xfs_dev_t;
 typedef __int64_t	xfs_daddr_t;
 
+typedef unsigned char		__u8;
+typedef signed char		__s8;
+typedef unsigned short		__u16;
+typedef signed short		__s16;
+typedef unsigned int		__u32;
+typedef signed int		__s32;
+typedef unsigned long long int	__u64;
+typedef signed long long int	__s64;
+
 #define	O_LARGEFILE	0
 
 #define HAVE_FID	1
diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h
index b83c144..95c4c13 100644
--- a/include/gnukfreebsd.h
+++ b/include/gnukfreebsd.h
@@ -42,6 +42,15 @@ typedef __uint64_t	xfs_ino_t;
 typedef __uint32_t	xfs_dev_t;
 typedef __int64_t	xfs_daddr_t;
 
+typedef unsigned char		__u8;
+typedef signed char		__s8;
+typedef unsigned short		__u16;
+typedef signed short		__s16;
+typedef unsigned int		__u32;
+typedef signed int		__s32;
+typedef unsigned long long int	__u64;
+typedef signed long long int	__s64;
+
 #define HAVE_FID	1
 
 static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
diff --git a/include/irix.h b/include/irix.h
index 31050c4..28564c8 100644
--- a/include/irix.h
+++ b/include/irix.h
@@ -47,6 +47,15 @@ typedef __int64_t	xfs_ino_t;
 typedef __int32_t	xfs_dev_t;
 typedef __int64_t	xfs_daddr_t;
 
+typedef unsigned char		__u8;
+typedef signed char		__s8;
+typedef unsigned short		__u16;
+typedef signed short		__s16;
+typedef unsigned int		__u32;
+typedef signed int		__s32;
+typedef unsigned long long int	__u64;
+typedef signed long long int	__s64;
+
 #define xfs_flock64	flock64
 #define xfs_flock64_t	struct flock64
 
diff --git a/include/linux.h b/include/linux.h
index 31c077a..cb6298f 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -28,6 +28,7 @@
 #include <getopt.h>
 #include <endian.h>
 #include <stdbool.h>
+#include <asm/types.h>
 
 static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
 {
diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
index 81741c4..db6cb2e 100644
--- a/include/platform_defs.h.in
+++ b/include/platform_defs.h.in
@@ -36,20 +36,6 @@
 #include <limits.h>
 #include <stdbool.h>
 
-#undef HAVE___U32
-#ifdef HAVE___U32
-#include <asm/types.h>
-#else
-typedef unsigned char		__u8;
-typedef signed char		__s8;
-typedef unsigned short		__u16;
-typedef signed short		__s16;
-typedef unsigned int		__u32;
-typedef signed int		__s32;
-typedef unsigned long long int	__u64;
-typedef signed long long int	__s64;
-#endif
-
 typedef struct filldir		filldir_t;
 
 #if defined(__linux__)
diff --git a/m4/package_types.m4 b/m4/package_types.m4
index c3645bc..4aa09a5 100644
--- a/m4/package_types.m4
+++ b/m4/package_types.m4
@@ -1,16 +1,3 @@
-# 
-# Check if we have a type for __u32
-# 
-AC_DEFUN([AC_TYPE_U32],
-  [ AC_MSG_CHECKING([for __u32 ])
-    AC_TRY_COMPILE([
-#include <asm/types.h>
-#include <stdlib.h>
-#include <stddef.h>
-    ], [
-         __u32  u32;
-    ], AC_DEFINE(HAVE___U32) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
-  ])
 #
 # Check if we have umode_t
 #
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2015-07-03 10:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
2015-07-03 10:12 ` [PATCH 01/13] xfsprogs: don't install internal header files Christoph Hellwig
2015-07-03 10:12 ` [PATCH 02/13] xfsprogs: remove unused macros from xfs_arch.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 03/13] xfsprogs: remove swab.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 04/13] xfsprogs: only install *format.h headers in install-qa Christoph Hellwig
2015-07-03 10:12 ` [PATCH 05/13] xfsprogs: remove install-qa target Christoph Hellwig
2015-07-03 10:12 ` [PATCH 06/13] xfsprogs: use <>-style includes in installed headers Christoph Hellwig
2015-07-03 10:12 ` [PATCH 07/13] xfsprogs: simplify internal includes Christoph Hellwig
2015-07-03 10:12 ` [PATCH 08/13] xfsprogs: move __be*/__le* types and __arch_pack to xfs_arch.h Christoph Hellwig
2015-07-03 10:12 ` Christoph Hellwig [this message]
2015-07-03 10:12 ` [PATCH 10/13] xfsprogs: include libxfs.h in libxfs_priv.h Christoph Hellwig
2015-07-03 23:42   ` Dave Chinner
2015-07-03 10:12 ` [PATCH 11/13] xfsprogs: don't install platform_defs.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 12/13] xfsprogs: remove filldir_t typedef Christoph Hellwig
2015-07-03 10:12 ` [PATCH 13/13] xfsprogs: remove the constpp define Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435918341-10128-10-git-send-email-hch@lst.de \
    --to=hch@lst.de \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox