Fix gcc init pragma warnings

Use constructor attribute on non-Solaris platforms.

The #pragma init/fini ->__attribute__((constructor/destructor))
conversions, these should go upstream.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf 2010-08-26 09:52:40 -07:00
parent e5dc681a50
commit 0ccd9d24e4
2 changed files with 11 additions and 1 deletions

View File

@ -249,7 +249,13 @@ uu_release_child(void)
uu_release(); uu_release();
} }
#ifdef __GNUC__
static void
uu_init(void) __attribute__((constructor));
#else
#pragma init(uu_init) #pragma init(uu_init)
#endif
static void static void
uu_init(void) uu_init(void)
{ {

View File

@ -518,8 +518,12 @@ static void (*_sa_update_sharetab_ts)(sa_handle_t);
* values to be used later. This is triggered by the runtime loader. * values to be used later. This is triggered by the runtime loader.
* Make sure the correct ISA version is loaded. * Make sure the correct ISA version is loaded.
*/ */
#ifdef __GNUC__
static void
_zfs_init_libshare(void) __attribute__((constructor));
#else
#pragma init(_zfs_init_libshare) #pragma init(_zfs_init_libshare)
#endif
static void static void
_zfs_init_libshare(void) _zfs_init_libshare(void)
{ {