]> wimlib.net Git - wimlib/blobdiff - src/util.c
Get rid of wimlib/version.h
[wimlib] / src / util.c
index fcfa962838529ba3190f1b5126cbea2cf63fd5b6..3b13c503f04095beda6646a849c6185f3ad7ed37 100644 (file)
 #  include "config.h"
 #endif
 
+/* Make sure the POSIX-compatible strerror_r() is declared, rather than the GNU
+ * version, which has a different return type. */
 #ifdef _GNU_SOURCE
 #  define _GNU_SOURCE_DEFINED 1
 #  undef _GNU_SOURCE
+#  ifndef _POSIX_C_SOURCE
+#    define _POSIX_C_SOURCE 200112L
+#  endif
 #endif
-/* Make sure the POSIX-compatible strerror_r() is declared, rather than the GNU
- * version, which has a different return type. */
 #include <string.h>
 #ifdef _GNU_SOURCE_DEFINED
 #  define _GNU_SOURCE
@@ -413,7 +416,6 @@ retry:
                        size++;
                        goto retry;
                }
-               ERROR("memory exhausted");
        }
        return ptr;
 }
@@ -429,10 +431,7 @@ wimlib_realloc(void *ptr, size_t size)
 {
        if (size == 0)
                size = 1;
-       ptr = (*wimlib_realloc_func)(ptr, size);
-       if (ptr == NULL)
-               ERROR("memory exhausted");
-       return ptr;
+       return (*wimlib_realloc_func)(ptr, size);
 }
 
 void *