aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-15 17:16:00 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-15 17:16:00 +0000
commitfe9ed45b0562df0437454ec3ddd2132ba9fc4c07 (patch)
tree3f107f0203614eab20317d4d725f6b03f760b37a /include
parent8d0211a11ec86c3df71f18606e2865d353209753 (diff)
Many Solaris fixes - this moves some of the stuff from utils.c to strcompat.c
Every OS uses strcompat now - this was done on purpose. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@42982 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/autoconfig.h.in3
-rw-r--r--include/asterisk/compat.h33
-rw-r--r--include/asterisk/strings.h24
-rw-r--r--include/asterisk/utils.h4
4 files changed, 34 insertions, 30 deletions
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index 87273bd8e..7a0a9a0c2 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -114,6 +114,9 @@
/* Define to 1 if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME
+/* Define to 1 if you have the `getloadavg' function. */
+#undef HAVE_GETLOADAVG
+
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
diff --git a/include/asterisk/compat.h b/include/asterisk/compat.h
index 8c2c6c4e6..ad4cfc616 100644
--- a/include/asterisk/compat.h
+++ b/include/asterisk/compat.h
@@ -18,19 +18,48 @@
#include <inttypes.h>
#include <sys/types.h>
+#include <stdarg.h>
-#ifndef HAVE_STRSEP
-char* strsep(char** str, const char* delims);
+#if !defined(HAVE_ASPRINTF) && !defined(__AST_DEBUG_MALLOC)
+int asprintf(char **str, const char *fmt, ...);
+#endif
+
+#ifndef HAVE_GETLOADAVG
+int getloadavg(double *list, int nelem);
#endif
#ifndef HAVE_SETENV
int setenv(const char *name, const char *value, int overwrite);
#endif
+#ifndef HAVE_STRCASESTR
+char *strcasestr(const char *, const char *);
+#endif
+
+#if !defined(HAVE_STRNDUP) && !defined(__AST_DEBUG_MALLOC)
+char *strndup(const char *, size_t);
+#endif
+
+#ifndef HAVE_STRNLEN
+size_t strnlen(const char *, size_t);
+#endif
+
+#ifndef HAVE_STRSEP
+char* strsep(char** str, const char* delims);
+#endif
+
+#ifndef HAVE_STRTOQ
+uint64_t strtoq(const char *nptr, char **endptr, int base);
+#endif
+
#ifndef HAVE_UNSETENV
int unsetenv(const char *name);
#endif
+#if !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC)
+int vasprintf(char **strp, const char *fmt, va_list ap);
+#endif
+
#ifdef SOLARIS
#define __BEGIN_DECLS
#define __END_DECLS
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index 6750a278d..fad6f2782 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -256,28 +256,4 @@ struct ast_realloca {
(ra)->ptr; \
})
-#ifndef HAVE_STRCASESTR
-char *strcasestr(const char *, const char *);
-#endif
-
-#if !defined(HAVE_STRNDUP) && !defined(__AST_DEBUG_MALLOC)
-char *strndup(const char *, size_t);
-#endif
-
-#ifndef HAVE_STRNLEN
-size_t strnlen(const char *, size_t);
-#endif
-
-#if !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC)
-int vasprintf(char **strp, const char *fmt, va_list ap);
-#endif
-
-#if !defined(HAVE_ASPRINTF) && !defined(__AST_DEBUG_MALLOC)
-int asprintf(char **str, const char *fmt, ...);
-#endif
-
-#ifndef HAVE_STRTOQ
-uint64_t strtoq(const char *nptr, char **endptr, int base);
-#endif
-
#endif /* _ASTERISK_STRINGS_H */
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index 41ca9339b..2fe5a87d3 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -264,10 +264,6 @@ int ast_pthread_create_stack(pthread_t *thread, pthread_attr_t *attr, void *(*st
*/
char *ast_process_quotes_and_slashes(char *start, char find, char replace_with);
-#ifndef HAVE_GETLOADAVG
-int getloadavg(double *list, int nelem);
-#endif
-
#ifdef linux
#define ast_random random
#else