]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/emu/mm.c (grub_memalign): Don't define if there is no
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 22 Aug 2013 14:16:29 +0000 (16:16 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 22 Aug 2013 14:16:29 +0000 (16:16 +0200)
implementation available to cause compile-time rather than runtime
error.

ChangeLog
grub-core/kern/emu/mm.c

index cba3f22c23a25a80fc2cc58df35a7ad44073cb99..accdd4c679c812440e5e98dd392610bbc0f0c4bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-08-22  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/emu/mm.c (grub_memalign): Don't define if there is no
+       implementation available to cause compile-time rather than runtime
+       error.
+
 2013-08-22  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/grub-fstest.c: Don't check for symlinks on windows.
index 0461ea51c971201194af7c31642a5465af20c571..10e1cc0d910a8f1f605bd573fb17747281dff6e3 100644 (file)
@@ -63,22 +63,20 @@ grub_realloc (void *ptr, grub_size_t size)
   return ret;
 }
 
+#if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN)
 void *
 grub_memalign (grub_size_t align, grub_size_t size)
 {
   void *p;
 
-#if defined(HAVE_POSIX_MEMALIGN)
   if (align < sizeof (void *))
     align = sizeof (void *);
+
+#if defined(HAVE_POSIX_MEMALIGN)
   if (posix_memalign (&p, align, size) != 0)
     p = 0;
 #elif defined(HAVE_MEMALIGN)
   p = memalign (align, size);
-#else
-  (void) align;
-  (void) size;
-  grub_util_error (_("grub_memalign is not supported on your system"));
 #endif
 
   if (!p)
@@ -86,3 +84,4 @@ grub_memalign (grub_size_t align, grub_size_t size)
 
   return p;
 }
+#endif