Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 214006 Details for
Bug 297243
sys-fs/e2fsprogs: build fails with C99 standard
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes e2fsprogs to compile with C99 inline rules v2
e2fsprogs-1.41.9-c99-inline-fixes.patch (text/plain), 13.54 KB, created by
Andrew Jeffery
on 2009-12-24 01:33:47 UTC
(
hide
)
Description:
Fixes e2fsprogs to compile with C99 inline rules v2
Filename:
MIME Type:
Creator:
Andrew Jeffery
Created:
2009-12-24 01:33:47 UTC
Size:
13.54 KB
patch
obsolete
>diff --git a/e2fsck/jfs_user.h b/e2fsck/jfs_user.h >index 60cc682..210f2ac 100644 >--- a/e2fsck/jfs_user.h >+++ b/e2fsck/jfs_user.h >@@ -70,25 +70,34 @@ typedef unsigned int __be32; > */ > #include <ext2fs/kernel-jbd.h> > >-/* >- * We use the standard libext2fs portability tricks for inline >- * functions. >- */ >-extern lkmem_cache_t * do_cache_create(int len); >-extern void do_cache_destroy(lkmem_cache_t *cache); >-extern size_t journal_tag_bytes(journal_t *journal); >- >+#if defined (__GNUC__) && !defined (__GNUC_STDC_INLINE__) && !defined (__GNUC_GNU_INLINE__) >+# define __GNUC_GNU_INLINE__ 1 /* GCCs earlier than 4.1.3 don't define this */ >+#endif >+#define STORAGE_CLASS extern > #if (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) > #ifdef E2FSCK_INCLUDE_INLINE_FUNCS > #define _INLINE_ extern > #else >-#ifdef __GNUC__ >+#if defined(__GNUC_GNU_INLINE__) > #define _INLINE_ extern __inline__ >+#elif defined(__GNUC_STDC_INLINE__) || \ >+ (defined(__STDC__) && __STDC_VERSION__ >= 199901L) >+#undef STORAGE_CLASS >+#define STORAGE_CLASS inline >+#define _INLINE_ inline > #else /* For Watcom C */ > #define _INLINE_ extern inline > #endif > #endif > >+/* >+ * We use the standard libext2fs portability tricks for inline >+ * functions. >+ */ >+STORAGE_CLASS lkmem_cache_t * do_cache_create(int len); >+STORAGE_CLASS void do_cache_destroy(lkmem_cache_t *cache); >+STORAGE_CLASS size_t journal_tag_bytes(journal_t *journal); >+ > _INLINE_ lkmem_cache_t * do_cache_create(int len) > { > lkmem_cache_t *new_cache; >@@ -114,6 +123,7 @@ _INLINE_ size_t journal_tag_bytes(journal_t *journal) > return JBD_TAG_SIZE32; > } > >+#undef STORAGE_CLASS > #undef _INLINE_ > #endif > >diff --git a/lib/ext2fs/bitops.h b/lib/ext2fs/bitops.h >index 32111ba..67bad84 100644 >--- a/lib/ext2fs/bitops.h >+++ b/lib/ext2fs/bitops.h >@@ -13,15 +13,34 @@ > * Linus Torvalds. > */ > >+#if defined (__GNUC__) && !defined (__GNUC_STDC_INLINE__) && !defined (__GNUC_GNU_INLINE__) >+# define __GNUC_GNU_INLINE__ 1 /* GCCs earlier than 4.1.3 don't define this */ >+#endif >+#define STORAGE_CLASS extern >+#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) >+#ifdef INCLUDE_INLINE_FUNCS >+#define _INLINE_ extern >+#else >+#if defined(__GNUC_GNU_INLINE__) >+#define _INLINE_ extern __inline__ >+#elif defined(__GNUC_STDC_INLINE__) || \ >+ (defined(__STDC__) && __STDC_VERSION__ >= 199901L) >+#undef STORAGE_CLASS >+#define STORAGE_CLASS inline >+#define _INLINE_ inline >+#else /* For Watcom C */ >+#define _INLINE_ extern inline >+#endif >+#endif > >-extern int ext2fs_set_bit(unsigned int nr,void * addr); >-extern int ext2fs_clear_bit(unsigned int nr, void * addr); >-extern int ext2fs_test_bit(unsigned int nr, const void * addr); >-extern void ext2fs_fast_set_bit(unsigned int nr,void * addr); >-extern void ext2fs_fast_clear_bit(unsigned int nr, void * addr); >-extern __u16 ext2fs_swab16(__u16 val); >-extern __u32 ext2fs_swab32(__u32 val); >-extern __u64 ext2fs_swab64(__u64 val); >+STORAGE_CLASS int ext2fs_set_bit(unsigned int nr,void * addr); >+STORAGE_CLASS int ext2fs_clear_bit(unsigned int nr, void * addr); >+STORAGE_CLASS int ext2fs_test_bit(unsigned int nr, const void * addr); >+STORAGE_CLASS void ext2fs_fast_set_bit(unsigned int nr,void * addr); >+STORAGE_CLASS void ext2fs_fast_clear_bit(unsigned int nr, void * addr); >+STORAGE_CLASS __u16 ext2fs_swab16(__u16 val); >+STORAGE_CLASS __u32 ext2fs_swab32(__u32 val); >+STORAGE_CLASS __u64 ext2fs_swab64(__u64 val); > > #ifdef WORDS_BIGENDIAN > #define ext2fs_cpu_to_le64(x) ext2fs_swab64((x)) >@@ -62,61 +81,61 @@ extern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg, > extern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap, > int code, unsigned long arg); > >-extern int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block); >-extern int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block); >+STORAGE_CLASS int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap, > blk_t block); >-extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block); >+STORAGE_CLASS int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block); > >-extern int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode); >-extern int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, >+STORAGE_CLASS int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode); >+STORAGE_CLASS int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, > ext2_ino_t inode); >-extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode); >+STORAGE_CLASS int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode); > >-extern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap, > blk_t block); >-extern void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap, > blk_t block); >-extern int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap, > blk_t block); > >-extern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, >+STORAGE_CLASS void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, > ext2_ino_t inode); >-extern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, >+STORAGE_CLASS void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, > ext2_ino_t inode); >-extern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap, >+STORAGE_CLASS int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap, > ext2_ino_t inode); >-extern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap); >-extern ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap); >-extern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap); >-extern ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap); >+STORAGE_CLASS blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap); >+STORAGE_CLASS ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap); >+STORAGE_CLASS blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap); >+STORAGE_CLASS ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap); > >-extern void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, > blk_t block, int num); >-extern void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, > blk_t block, int num); >-extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, > blk_t block, int num); >-extern int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap, >+STORAGE_CLASS int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap, > ino_t inode, int num); >-extern void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, > blk_t block, int num); >-extern void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, > blk_t block, int num); >-extern int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap, > blk_t block, int num); >-extern void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map); >+STORAGE_CLASS void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map); > > /* These routines moved to gen_bitmap.c */ >-extern int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap, >+STORAGE_CLASS int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap, > __u32 bitno); >-extern int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap, >+STORAGE_CLASS int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap, > blk_t bitno); >-extern int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap, >+STORAGE_CLASS int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap, > blk_t bitno); >-extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, >+STORAGE_CLASS int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, > blk_t block, int num); >-extern __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap); >-extern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap); >+STORAGE_CLASS __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap); >+STORAGE_CLASS __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap); > > /* > * The inline routines themselves... >@@ -134,17 +153,6 @@ extern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap); > #endif > #endif /* NO_INLINE_FUNCS */ > >-#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) >-#ifdef INCLUDE_INLINE_FUNCS >-#define _INLINE_ extern >-#else >-#ifdef __GNUC__ >-#define _INLINE_ extern __inline__ >-#else /* For Watcom C */ >-#define _INLINE_ extern inline >-#endif >-#endif >- > /* > * Fast bit set/clear functions that doesn't need to return the > * previous bit value. >@@ -423,6 +431,7 @@ _INLINE_ void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, > { > ext2fs_unmark_block_bitmap_range(bitmap, block, num); > } >+ >+#undef STORAGE_CLASS > #undef _INLINE_ > #endif >- >diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h >index 234fbdd..8a36d18 100644 >--- a/lib/ext2fs/ext2fs.h >+++ b/lib/ext2fs/ext2fs.h >@@ -241,7 +241,7 @@ struct struct_ext2_filsys { > #if EXT2_FLAT_INCLUDES > #include "e2_bitops.h" > #else >-#include <ext2fs/bitops.h> >+#include "bitops.h" > #endif > > /* >@@ -1143,50 +1143,59 @@ extern errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list, > unsigned int flags, > FILE *f); > >- >-/* inline functions */ >-extern errcode_t ext2fs_get_mem(unsigned long size, void *ptr); >-extern errcode_t ext2fs_get_array(unsigned long count, unsigned long size, void *ptr); >-extern errcode_t ext2fs_free_mem(void *ptr); >-extern errcode_t ext2fs_resize_mem(unsigned long old_size, >- unsigned long size, void *ptr); >-extern void ext2fs_mark_super_dirty(ext2_filsys fs); >-extern void ext2fs_mark_changed(ext2_filsys fs); >-extern int ext2fs_test_changed(ext2_filsys fs); >-extern void ext2fs_mark_valid(ext2_filsys fs); >-extern void ext2fs_unmark_valid(ext2_filsys fs); >-extern int ext2fs_test_valid(ext2_filsys fs); >-extern void ext2fs_mark_ib_dirty(ext2_filsys fs); >-extern void ext2fs_mark_bb_dirty(ext2_filsys fs); >-extern int ext2fs_test_ib_dirty(ext2_filsys fs); >-extern int ext2fs_test_bb_dirty(ext2_filsys fs); >-extern int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk); >-extern int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino); >-extern blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group); >-extern blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group); >-extern blk_t ext2fs_inode_data_blocks(ext2_filsys fs, >- struct ext2_inode *inode); >-extern unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b); >- > /* > * The actual inlined functions definitions themselves... > * > * If NO_INLINE_FUNCS is defined, then we won't try to do inline > * functions at all! > */ >+#if defined (__GNUC__) && !defined (__GNUC_STDC_INLINE__) && !defined (__GNUC_GNU_INLINE__) >+# define __GNUC_GNU_INLINE__ 1 /* GCCs earlier than 4.1.3 don't define this */ >+#endif >+#define STORAGE_CLASS extern > #if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) > #ifdef INCLUDE_INLINE_FUNCS > #define _INLINE_ extern > #else >-#ifdef __GNUC__ >+#if defined(__GNUC_GNU_INLINE__) > #define _INLINE_ extern __inline__ >+#elif defined(__GNUC_STDC_INLINE__) || \ >+ (defined(__STDC__) && __STDC_VERSION__ >= 199901L) >+#undef STORAGE_CLASS >+#define STORAGE_CLASS inline >+#define _INLINE_ inline > #else /* For Watcom C */ > #define _INLINE_ extern inline > #endif > #endif > >+/* inline functions */ >+STORAGE_CLASS errcode_t ext2fs_get_mem(unsigned long size, void *ptr); >+STORAGE_CLASS errcode_t ext2fs_get_array(unsigned long count, unsigned long size, void *ptr); >+STORAGE_CLASS errcode_t ext2fs_free_mem(void *ptr); >+STORAGE_CLASS errcode_t ext2fs_resize_mem(unsigned long old_size, >+ unsigned long size, void *ptr); >+STORAGE_CLASS void ext2fs_mark_super_dirty(ext2_filsys fs); >+STORAGE_CLASS void ext2fs_mark_changed(ext2_filsys fs); >+STORAGE_CLASS int ext2fs_test_changed(ext2_filsys fs); >+STORAGE_CLASS void ext2fs_mark_valid(ext2_filsys fs); >+STORAGE_CLASS void ext2fs_unmark_valid(ext2_filsys fs); >+STORAGE_CLASS int ext2fs_test_valid(ext2_filsys fs); >+STORAGE_CLASS void ext2fs_mark_ib_dirty(ext2_filsys fs); >+STORAGE_CLASS void ext2fs_mark_bb_dirty(ext2_filsys fs); >+STORAGE_CLASS int ext2fs_test_ib_dirty(ext2_filsys fs); >+STORAGE_CLASS int ext2fs_test_bb_dirty(ext2_filsys fs); >+STORAGE_CLASS int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk); >+STORAGE_CLASS int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino); >+STORAGE_CLASS blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group); >+STORAGE_CLASS blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group); >+STORAGE_CLASS blk_t ext2fs_inode_data_blocks(ext2_filsys fs, >+ struct ext2_inode *inode); >+STORAGE_CLASS unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b); >+ > #ifndef EXT2_CUSTOM_MEMORY_ROUTINES > #include <string.h> >+ > /* > * Allocate memory > */ >@@ -1374,6 +1383,8 @@ _INLINE_ unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b) > return 0; > return ((a - 1) / b) + 1; > } >+ >+#undef STORAGE_CLASS > #undef _INLINE_ > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 297243
:
213253
|
213255
|
213717
|
213719
| 214006