+2011-04-08 Eric Blake <eblake@redhat.com>
+
+ careadlink: fix compilation error on mingw
+ * lib/careadlinkat.c (standard_allocator): Avoid renaming fields
+ within struct allocator.
+
2011-04-06 Eric Blake <eblake@redhat.com>
binary-io: relicense under LGPLv2+
#include <string.h>
#include <unistd.h>
-/* Use the system functions, not the gnulib overrides, because this
- module does not depend on GNU or POSIX semantics. */
-#undef malloc
-#undef realloc
-
/* Define this independently so that stdint.h is not a prerequisite. */
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
}
#endif
-/* A standard allocator. For now, only careadlinkat needs this, but
- perhaps it should be moved to the allocator module. */
-static struct allocator const standard_allocator =
- { malloc, realloc, free, NULL };
+/* Forward declaration. We want to #undef malloc before initializing
+ this struct, but cannot do so until after all code that uses named
+ fields from "allocator.h" has been compiled. */
+static struct allocator const standard_allocator;
/* Assuming the current directory is FD, get the symbolic link value
of FILENAME as a null-terminated string and put it into a buffer.
errno = ENOMEM;
return NULL;
}
+
+/* Use the system functions, not the gnulib overrides, because this
+ module does not depend on GNU or POSIX semantics. See comments
+ above why this must occur here. */
+#undef malloc
+#undef realloc
+
+/* A standard allocator. For now, only careadlinkat needs this, but
+ perhaps it should be moved to the allocator module. */
+static struct allocator const standard_allocator =
+ { malloc, realloc, free, NULL };