From: Karel Zak Date: Wed, 3 Dec 2008 22:34:23 +0000 (+0100) Subject: blkid: remove blkid_types.h X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1ad8bb397f604398ebae084ab7255213185bbce;p=util-linux blkid: remove blkid_types.h We needn't to use kernel types, in userspace we have portable stdint.h. Signed-off-by: Karel Zak --- diff --git a/configure.ac b/configure.ac index 4186d40d..25ba6748 100644 --- a/configure.ac +++ b/configure.ac @@ -795,7 +795,6 @@ libs/blkid/libblkid.3 libs/blkid/blkid.8 libs/blkid/Makefile libs/blkid/bin/Makefile -libs/blkid/src/blkid_types.h libs/blkid/src/Makefile libs/blkid/src/probers/Makefile login-utils/Makefile diff --git a/libs/blkid/.gitignore b/libs/blkid/.gitignore index d3c0028c..e886cb89 100644 --- a/libs/blkid/.gitignore +++ b/libs/blkid/.gitignore @@ -1,4 +1,3 @@ *.[38] -blkid_types.h *.sh bin/blkid diff --git a/libs/blkid/src/Makefile.am b/libs/blkid/src/Makefile.am index 58f30af6..202fe4af 100644 --- a/libs/blkid/src/Makefile.am +++ b/libs/blkid/src/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS += -I$(top_builddir)/libs/blkid/src lib_LIBRARIES = libblkid.a libblkid_a_SOURCES = cache.c dev.c devname.c devno.c getsize.c llseek.c \ probe.c read.c resolve.c save.c tag.c version.c verify.c \ - blkid.h blkidP.h list.h blkid_types.h probers/probers.h \ + blkid.h blkidP.h list.h probers/probers.h \ $(top_srcdir)/lib/blkdev.c $(top_srcdir)/lib/linux_version.c libblkid_a_LIBADD = probers/libprobers.a libblkid_a_CFLAGS = -fPIC @@ -28,7 +28,7 @@ if HAVE_UUID blkid_OTHERLDADD += -luuid #TODO $(UUID_LIBS) endif -EXTRA_DIST = blkid.sym blkid_types.h.in +EXTRA_DIST = blkid.sym all-local: $(blkid_LIB) diff --git a/libs/blkid/src/blkid.h b/libs/blkid/src/blkid.h index c31a9b89..be6f7e06 100644 --- a/libs/blkid/src/blkid.h +++ b/libs/blkid/src/blkid.h @@ -23,8 +23,8 @@ #ifndef _BLKID_BLKID_H #define _BLKID_BLKID_H +#include #include -#include #ifdef __cplusplus extern "C" { @@ -34,7 +34,7 @@ typedef struct blkid_struct_dev *blkid_dev; typedef struct blkid_struct_cache *blkid_cache; typedef struct blkid_struct_probe *blkid_probe; -typedef __s64 blkid_loff_t; +typedef int64_t blkid_loff_t; typedef struct blkid_struct_tag_iterate *blkid_tag_iterate; typedef struct blkid_struct_dev_iterate *blkid_dev_iterate; diff --git a/libs/blkid/src/blkid_types.h.in b/libs/blkid/src/blkid_types.h.in deleted file mode 100644 index 4efffba3..00000000 --- a/libs/blkid/src/blkid_types.h.in +++ /dev/null @@ -1,134 +0,0 @@ -/* - * If linux/types.h is already been included, assume it has defined - * everything we need. (cross fingers) Other header files may have - * also defined the types that we need. - */ -#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \ - !defined(_EXT2_TYPES_H)) -#define _BLKID_TYPES_H - -@ASM_TYPES_HEADER@ - -#ifdef __U8_TYPEDEF -typedef __U8_TYPEDEF __u8; -#else -typedef unsigned char __u8; -#endif - -#ifdef __S8_TYPEDEF -typedef __S8_TYPEDEF __s8; -#else -typedef signed char __s8; -#endif - -#ifdef __U16_TYPEDEF -typedef __U16_TYPEDEF __u16; -#else -#if (@SIZEOF_INT@ == 2) -typedef unsigned int __u16; -#else -#if (@SIZEOF_SHORT@ == 2) -typedef unsigned short __u16; -#else - ?==error: undefined 16 bit type -#endif /* SIZEOF_SHORT == 2 */ -#endif /* SIZEOF_INT == 2 */ -#endif /* __U16_TYPEDEF */ - -#ifdef __S16_TYPEDEF -typedef __S16_TYPEDEF __s16; -#else -#if (@SIZEOF_INT@ == 2) -typedef int __s16; -#else -#if (@SIZEOF_SHORT@ == 2) -typedef short __s16; -#else - ?==error: undefined 16 bit type -#endif /* SIZEOF_SHORT == 2 */ -#endif /* SIZEOF_INT == 2 */ -#endif /* __S16_TYPEDEF */ - - -#ifdef __U32_TYPEDEF -typedef __U32_TYPEDEF __u32; -#else -#if (@SIZEOF_INT@ == 4) -typedef unsigned int __u32; -#else -#if (@SIZEOF_LONG@ == 4) -typedef unsigned long __u32; -#else -#if (@SIZEOF_SHORT@ == 4) -typedef unsigned short __u32; -#else - ?== error: undefined 32 bit type -#endif /* SIZEOF_SHORT == 4 */ -#endif /* SIZEOF_LONG == 4 */ -#endif /* SIZEOF_INT == 4 */ -#endif /* __U32_TYPEDEF */ - -#ifdef __S32_TYPEDEF -typedef __S32_TYPEDEF __s32; -#else -#if (@SIZEOF_INT@ == 4) -typedef int __s32; -#else -#if (@SIZEOF_LONG@ == 4) -typedef long __s32; -#else -#if (@SIZEOF_SHORT@ == 4) -typedef short __s32; -#else - ?== error: undefined 32 bit type -#endif /* SIZEOF_SHORT == 4 */ -#endif /* SIZEOF_LONG == 4 */ -#endif /* SIZEOF_INT == 4 */ -#endif /* __S32_TYPEDEF */ - -#ifdef __U64_TYPEDEF -typedef __U64_TYPEDEF __u64; -#else -#if (@SIZEOF_INT@ == 8) -typedef unsigned int __u64; -#else -#if (@SIZEOF_LONG@ == 8) -typedef unsigned long __u64; -#else -#if (@SIZEOF_LONG_LONG@ == 8) -typedef unsigned long long __u64; -#endif /* SIZEOF_LONG_LONG == 8 */ -#endif /* SIZEOF_LONG == 8 */ -#endif /* SIZEOF_INT == 8 */ -#endif /* __U64_TYPEDEF */ - -#ifdef __S64_TYPEDEF -typedef __S64_TYPEDEF __s64; -#else -#if (@SIZEOF_INT@ == 8) -typedef int __s64; -#else -#if (@SIZEOF_LONG@ == 8) -typedef long __s64; -#else -#if (@SIZEOF_LONG_LONG@ == 8) -#if defined(__GNUC__) -typedef __signed__ long long __s64; -#else -typedef signed long long __s64; -#endif /* __GNUC__ */ -#endif /* SIZEOF_LONG_LONG == 8 */ -#endif /* SIZEOF_LONG == 8 */ -#endif /* SIZEOF_INT == 8 */ -#endif /* __S64_TYPEDEF */ - -#undef __S8_TYPEDEF -#undef __U8_TYPEDEF -#undef __S16_TYPEDEF -#undef __U16_TYPEDEF -#undef __S32_TYPEDEF -#undef __U32_TYPEDEF -#undef __S64_TYPEDEF -#undef __U64_TYPEDEF - -#endif /* _*_TYPES_H */ diff --git a/libs/blkid/src/probers/vfat.c b/libs/blkid/src/probers/vfat.c index b12ab63a..80d9ff8f 100644 --- a/libs/blkid/src/probers/vfat.c +++ b/libs/blkid/src/probers/vfat.c @@ -272,7 +272,7 @@ static int probe_vfat(blkid_probe pr, const struct blkid_idmag *mag) next = le32_to_cpu(vs->vs_root_cluster); while (next && --maxloop) { uint32_t next_sect_off; - __u64 next_off, fat_entry_off; + uint64_t next_off, fat_entry_off; int count; next_sect_off = (next - 2) * vs->vs_cluster_size; diff --git a/libs/blkid/src/tst_types.c b/libs/blkid/src/tst_types.c index 3003c8b5..ecbc0321 100644 --- a/libs/blkid/src/tst_types.c +++ b/libs/blkid/src/tst_types.c @@ -1,5 +1,5 @@ /* - * This testing program makes sure the blkid_types header file + * This testing program makes sure the stdint.h header file * * Copyright (C) 2006 by Theodore Ts'o. * @@ -10,54 +10,54 @@ */ #include -#include "blkid/blkid_types.h" +#include #include #include int main(int argc, char **argv) { - if (sizeof(__u8) != 1) { - printf("Sizeof(__u8) is %d should be 1\n", - (int)sizeof(__u8)); + if (sizeof(uint8_t) != 1) { + printf("Sizeof(uint8_t) is %d should be 1\n", + (int)sizeof(uint8_t)); exit(1); } - if (sizeof(__s8) != 1) { - printf("Sizeof(_s8) is %d should be 1\n", - (int)sizeof(__s8)); + if (sizeof(int8_t) != 1) { + printf("Sizeof(int8_t) is %d should be 1\n", + (int)sizeof(int8_t)); exit(1); } - if (sizeof(__u16) != 2) { - printf("Sizeof(__u16) is %d should be 2\n", - (int)sizeof(__u16)); + if (sizeof(uint16_t) != 2) { + printf("Sizeof(uint16_t) is %d should be 2\n", + (int)sizeof(uint16_t)); exit(1); } - if (sizeof(__s16) != 2) { - printf("Sizeof(__s16) is %d should be 2\n", - (int)sizeof(__s16)); + if (sizeof(int16_t) != 2) { + printf("Sizeof(int16_t) is %d should be 2\n", + (int)sizeof(int16_t)); exit(1); } - if (sizeof(__u32) != 4) { - printf("Sizeof(__u32) is %d should be 4\n", - (int)sizeof(__u32)); + if (sizeof(uint32_t) != 4) { + printf("Sizeof(uint32_t) is %d should be 4\n", + (int)sizeof(uint32_t)); exit(1); } - if (sizeof(__s32) != 4) { - printf("Sizeof(__s32) is %d should be 4\n", - (int)sizeof(__s32)); + if (sizeof(int32_t) != 4) { + printf("Sizeof(int32_t) is %d should be 4\n", + (int)sizeof(int32_t)); exit(1); } - if (sizeof(__u64) != 8) { - printf("Sizeof(__u64) is %d should be 8\n", - (int)sizeof(__u64)); + if (sizeof(uint64_t) != 8) { + printf("Sizeof(uint64_t) is %d should be 8\n", + (int)sizeof(uint64_t)); exit(1); } - if (sizeof(__s64) != 8) { - printf("Sizeof(__s64) is %d should be 8\n", - (int)sizeof(__s64)); + if (sizeof(int64_t) != 8) { + printf("Sizeof(int64_t) is %d should be 8\n", + (int)sizeof(int64_t)); exit(1); } - printf("The blkid_types.h types are correct.\n"); + printf("The stdint.h types are correct.\n"); exit(0); }