The following commit has been merged in the master branch:
commit e6ca514f9f5817a73b1849ef09b2e60931612962
Author: Guillem Jover <[email protected]>
Date: Sun Dec 11 04:54:29 2011 +0100
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.
diff --git a/lib/compat/alphasort.c b/lib/compat/alphasort.c
index f307ef2..1c946d4 100644
--- a/lib/compat/alphasort.c
+++ b/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
diff --git a/lib/compat/asprintf.c b/lib/compat/asprintf.c
index 223d514..6cd7eb1 100644
--- a/lib/compat/asprintf.c
+++ b/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
diff --git a/lib/compat/scandir.c b/lib/compat/scandir.c
index 4faece4..35551fc 100644
--- a/lib/compat/scandir.c
+++ b/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
diff --git a/lib/compat/snprintf.c b/lib/compat/snprintf.c
index 5dd6705..dface64 100644
--- a/lib/compat/snprintf.c
+++ b/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
diff --git a/lib/compat/strerror.c b/lib/compat/strerror.c
index ea8f1d7..e9666bb 100644
--- a/lib/compat/strerror.c
+++ b/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
diff --git a/lib/compat/strndup.c b/lib/compat/strndup.c
index 2159a46..bb7a572 100644
--- a/lib/compat/strndup.c
+++ b/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
diff --git a/lib/compat/strsignal.c b/lib/compat/strsignal.c
index b4e3dbe..92fad03 100644
--- a/lib/compat/strsignal.c
+++ b/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
diff --git a/lib/compat/unsetenv.c b/lib/compat/unsetenv.c
index 7551629..1bcdf7b 100644
--- a/lib/compat/unsetenv.c
+++ b/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
diff --git a/lib/compat/vasprintf.c b/lib/compat/vasprintf.c
index 3d2bb30..a003783 100644
--- a/lib/compat/vasprintf.c
+++ b/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
diff --git a/lib/compat/vsnprintf.c b/lib/compat/vsnprintf.c
index 6e08cef..c7f100a 100644
--- a/lib/compat/vsnprintf.c
+++ b/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
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]