]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* include/grub/dl.h: Remove double declaration of GRUB_MOD_DEP.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 18 Oct 2013 14:41:50 +0000 (16:41 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 18 Oct 2013 14:41:50 +0000 (16:41 +0200)
Use __unused__ rather than __used__ on gcc < 3.2.

ChangeLog
include/grub/dl.h

index 54bf2d6951e73c02bd8fb37067b90c0d84cbc4d3..5788821d26bf5e4ad682c251695cae7e6cc2d5c3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-18  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * include/grub/dl.h: Remove double declaration of GRUB_MOD_DEP.
+       Use __unused__ rather than __used__ on gcc < 3.2.
+
 2013-10-18  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * include/grub/setjmp.h: Define RETURNS_TWICE. Keep it empty for
index f34b5a1ac7a3bdb1c9ec5c0ea4174fe53dc58425..80aac4979e7a17ec2aaefaffd2193803ce728817 100644 (file)
@@ -91,15 +91,6 @@ grub_mod_fini (void)
 #endif
 #endif
 
-#ifndef ASM_FILE
-#define GRUB_MOD_DEP(name)     \
-static const char grub_module_depend_##name[] \
-  __attribute__((section(GRUB_MOD_SECTION(moddeps)), __used__)) = #name
-#define GRUB_MOD_NAME(name)    \
-static const char grub_module_name_##name[] \
- __attribute__((section(GRUB_MOD_SECTION(modname)), __used__)) = #name
-#endif
-
 /* Me, Vladimir Serbinenko, hereby I add this module check as per new
    GNU module policy. Note that this license check is informative only.
    Modules have to be licensed under GPLv3 or GPLv3+ (optionally
@@ -109,11 +100,19 @@ static const char grub_module_name_##name[] \
    Be sure to understand your license obligations.
 */
 #ifndef ASM_FILE
+#if GNUC_PREREQ (3,2)
+#define ATTRIBUTE_USED __used__
+#else
+#define ATTRIBUTE_USED __unused__
+#endif
 #define GRUB_MOD_LICENSE(license)      \
-  static char grub_module_license[] __attribute__ ((section (GRUB_MOD_SECTION (module_license)), used)) = "LICENSE=" license;
+  static char grub_module_license[] __attribute__ ((section (GRUB_MOD_SECTION (module_license)), ATTRIBUTE_USED)) = "LICENSE=" license;
 #define GRUB_MOD_DEP(name)     \
 static const char grub_module_depend_##name[] \
- __attribute__((section(GRUB_MOD_SECTION(moddeps)), __used__)) = #name
+ __attribute__((section(GRUB_MOD_SECTION(moddeps)), ATTRIBUTE_USED)) = #name
+#define GRUB_MOD_NAME(name)    \
+static const char grub_module_name_##name[] \
+ __attribute__((section(GRUB_MOD_SECTION(modname)), __used__)) = #name
 #else
 #ifdef __APPLE__
 .macro GRUB_MOD_LICENSE