implementation available to cause compile-time rather than runtime
error.
+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.
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)
return p;
}
+#endif