2005-11-07 Kevin P. Fleming <kpfleming@digium.com>
+ * many files: more Cygwin compatibility, and proper getloadavg() prototype/macro (issue #5569)
+
* include/asterisk/lock.h (__ast_pthread_mutex_lock): correct build with DETECT_DEADLOCKS defined (issue #5570)
2005-11-07 Russell Bryant <russell@digium.com>
#include "asterisk/version.h"
#include "asterisk/linkedlists.h"
#include "asterisk/devicestate.h"
+#include "asterisk/compat.h"
#include "asterisk/doxyref.h" /* Doxygen documentation */
ifeq (${OSARCH},CYGWIN)
CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
CYGSOLIB=-L.. -L. -lasterisk.dll
+else
+CFLAGS+=-fPIC
endif
ifneq ($(wildcard g723.1/coder.c),)
LIBILBC=ilbc/libilbc.a
endif
-CFLAGS+=-fPIC
LIBGSM=gsm/lib/libgsm.a
LIBGSMT=gsm/lib/libgsm.a
ARCH=$(PROC)
-CFLAGS+=-Wall -fPIC -O3 -funroll-loops
+CFLAGS+=-Wall -O3 -funroll-loops
+ifneq (${OSARCH},CYGWIN)
+CFLAGS += -fPIC
+endif
LIB=libilbc.a
OBJS= anaFilter.o iCBSearch.o packing.o \
#
WARNINGS = -Wall -Wno-comment -Wno-error
-CFLAGS += $(OPTIMIZE) -I$(LIB_TARGET_DIR) $(WARNINGS) -fPIC
+CFLAGS += $(OPTIMIZE) -I$(LIB_TARGET_DIR) $(WARNINGS)
+ifneq (${OSARCH},CYGWIN)
+CFLAGS += -fPIC
+endif
#CFLAGS+= $(shell if uname -m | grep -q 86; then echo "-mpentium" ; fi)
#fix for PPC processors and ALPHA, And UltraSparc too
#define HAVE_VASPRINTF
#define HAVE_STRTOQ
+#ifdef _BSD_SOURCE
+#define HAVE_GETLOADAVG
+#endif
+
#ifdef __linux__
#define HAVE_STRCASESTR
#define HAVE_STRNDUP
*/
char *ast_process_quotes_and_slashes(char *start, char find, char replace_with);
+#ifndef HAVE_GETLOADAVG
+int getloadavg(double *list, int nelem);
+#endif
+
#endif /* _ASTERISK_UTILS_H */
#include "asterisk/musiconhold.h"
#include "asterisk/app.h"
#include "asterisk/devicestate.h"
+#include "asterisk/compat.h"
/*!
* \note I M P O R T A N T :
#define OPEN_MODE O_RDONLY
#endif /* !defined O_BINARY */
+#ifdef SOLARIS
+#undef TM_ZONE
+#undef TM_GMTOFF
+#endif
+
+#ifdef TM_ZONE
#ifndef WILDABBR
/*! \note
* Someone might make incorrect use of a time zone abbreviation:
#endif /* !defined WILDABBR */
static char wildabbr[] = "WILDABBR";
+#endif /* TM_ZONE */
/*! \brief FreeBSD defines 'zone' in 'struct tm' as non-const, so don't declare this
string as const. */
#define MY_TZNAME_MAX 255
#endif /* !defined TZNAME_MAX */
-#ifdef SOLARIS
-#undef TM_ZONE
-#undef TM_GMTOFF
-#endif
-
-
struct state {
char name[TZ_STRLEN_MAX + 1];
int leapcnt;
}
#endif /* !HAVE_STRTOQ */
-#if (!defined(_BSD_SOURCE))
+#ifndef HAVE_GETLOADAVG
#ifdef linux
/* Alternative method of getting load avg on Linux only */
int getloadavg(double *list, int nelem)