Просмотр исходного кода

libcompat: Do not ifdef out compatibility code definitions

The code is already selected (or not) to be included by the Makefile
machinery, there's no need to disabled it too in the actual code, and
not doing so will allow to test it later on.
Guillem Jover лет назад: 14
Родитель
Сommit
e6ca514f9f

+ 0 - 2
lib/compat/alphasort.c

@@ -22,7 +22,6 @@
 #include <string.h>
 #include <dirent.h>
 
-#ifndef HAVE_ALPHASORT
 int
 alphasort(const void *a, const void *b)
 {
@@ -30,4 +29,3 @@ alphasort(const void *a, const void *b)
 	              (*(const struct dirent **)b)->d_name);
 
 }
-#endif

+ 0 - 2
lib/compat/asprintf.c

@@ -22,7 +22,6 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#ifndef HAVE_ASPRINTF
 int
 asprintf(char **strp, char const *fmt, ...)
 {
@@ -35,4 +34,3 @@ asprintf(char **strp, char const *fmt, ...)
 
 	return n;
 }
-#endif

+ 0 - 2
lib/compat/scandir.c

@@ -26,7 +26,6 @@
 #include <dirent.h>
 #include <stdlib.h>
 
-#ifndef HAVE_SCANDIR
 static int
 cleanup(DIR *dir, struct dirent **dirlist, int used)
 {
@@ -97,4 +96,3 @@ scandir(const char *dir, struct dirent ***namelist,
 
 	return used;
 }
-#endif

+ 0 - 2
lib/compat/snprintf.c

@@ -24,7 +24,6 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#ifndef HAVE_SNPRINTF
 int
 snprintf(char *str, size_t n, char const *fmt, ...)
 {
@@ -37,4 +36,3 @@ snprintf(char *str, size_t n, char const *fmt, ...)
 
 	return i;
 }
-#endif

+ 0 - 2
lib/compat/strerror.c

@@ -24,7 +24,6 @@
 
 #define _(str) gettext(str)
 
-#ifndef HAVE_STRERROR
 extern const char *const sys_errlist[];
 extern const int sys_nerr;
 
@@ -40,4 +39,3 @@ strerror(int e)
 
 	return buf;
 }
-#endif

+ 0 - 2
lib/compat/strndup.c

@@ -23,7 +23,6 @@
 #include <string.h>
 #include <stdlib.h>
 
-#ifndef HAVE_STRNDUP
 #undef strndup
 
 char *
@@ -42,4 +41,3 @@ strndup(const char *s, size_t n)
 
 	return str;
 }
-#endif

+ 0 - 2
lib/compat/strsignal.c

@@ -56,7 +56,6 @@ const char *const sys_siglist[] = {
 extern const char *const sys_siglist[];
 #endif
 
-#ifndef HAVE_STRSIGNAL
 const char *
 strsignal(int s)
 {
@@ -69,4 +68,3 @@ strsignal(int s)
 
 	return buf;
 }
-#endif

+ 0 - 2
lib/compat/unsetenv.c

@@ -22,7 +22,6 @@
 #include <string.h>
 #include <stdlib.h>
 
-#ifndef HAVE_UNSETENV
 int
 unsetenv(const char *p)
 {
@@ -36,4 +35,3 @@ unsetenv(const char *p)
 	strcat(q, "=");
 	return putenv(q);
 }
-#endif

+ 0 - 2
lib/compat/vasprintf.c

@@ -23,7 +23,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#ifndef HAVE_VASPRINTF
 int
 vasprintf(char **strp, char const *fmt, va_list args)
 {
@@ -56,4 +55,3 @@ vasprintf(char **strp, char const *fmt, va_list args)
 
 	return n;
 }
-#endif

+ 0 - 2
lib/compat/vsnprintf.c

@@ -24,7 +24,6 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#ifndef HAVE_VSNPRINTF
 int
 vsnprintf(char *buf, size_t maxsize, const char *fmt, va_list args)
 {
@@ -68,4 +67,3 @@ vsnprintf(char *buf, size_t maxsize, const char *fmt, va_list args)
 
 	return total;
 }
-#endif