diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2012-05-29 16:41:17 -0700 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2012-05-29 16:41:17 -0700 |
commit | dfd03ae23ee9d8afd2e67bdc9a4427d329e93e90 (patch) | |
tree | d5d7181bc87292701bccbe0a4cc8e32ea8304e56 | |
parent | 5c219ca67d6e895d423863d996494ac8aed40d8a (diff) | |
download | pkg-config-dfd03ae23ee9d8afd2e67bdc9a4427d329e93e90.tar.gz |
Use g_alloca instead of fooling around with platforms ourselves
Glib has been providing a g_alloca wrapper that handles all the platform
specifics since at least glib-1.3. Use it.
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | pkg.c | 12 |
2 files changed, 2 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index fd87128..9f3d4ba 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,6 @@ dnl Check for headers AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h]) dnl Check for library functions -AC_FUNC_ALLOCA AC_CHECK_FUNCS(setresuid setreuid,break) @@ -25,14 +25,6 @@ #include "pkg.h" #include "parse.h" -#ifdef HAVE_ALLOCA_H -# include <alloca.h> -#else -# ifdef _AIX -# pragma alloca -# endif -#endif - #ifdef HAVE_MALLOC_H # include <malloc.h> #endif @@ -1276,8 +1268,8 @@ static int rpmvercmp(const char * a, const char * b) { /* easy comparison to see if versions are identical */ if (!strcmp(a, b)) return 0; - str1 = alloca(strlen(a) + 1); - str2 = alloca(strlen(b) + 1); + str1 = g_alloca(strlen(a) + 1); + str2 = g_alloca(strlen(b) + 1); strcpy(str1, a); strcpy(str2, b); |