summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-09-10 16:33:48 +0000
committerBenny Prijono <bennylp@teluu.com>2006-09-10 16:33:48 +0000
commit059856aee28d01b0a28ee86b6fb6efc2060229c2 (patch)
tree889ff00b1fc97157ebb945b3101bc046f02c2f28 /pjlib
parent49ff9b1d0c7c4ffb20e8b92bd6f42549034eeceb (diff)
Fixed autoconf in mingw
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@699 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/build/os-auto.mak.in12
-rw-r--r--pjlib/include/pj/compat/os_auto.h.in14
-rw-r--r--pjlib/include/pj/compat/socket.h13
-rw-r--r--pjlib/src/pjlib-test/ioq_unreg.c2
4 files changed, 29 insertions, 12 deletions
diff --git a/pjlib/build/os-auto.mak.in b/pjlib/build/os-auto.mak.in
index f441104c..e4bfe62b 100644
--- a/pjlib/build/os-auto.mak.in
+++ b/pjlib/build/os-auto.mak.in
@@ -1,17 +1,19 @@
# @configure_input@
+# Determine OS specific files
+AC_OS_OBJS=@ac_os_objs@
+
#
# PJLIB_OBJS specified here are object files to be included in PJLIB
# (the library) for this specific operating system. Object files common
# to all operating systems should go in Makefile instead.
#
-export PJLIB_OBJS += addr_resolv_sock.o guid_simple.o \
- log_writer_stdout.o os_core_unix.o \
- os_error_unix.o os_time_unix.o \
- os_timestamp_common.o os_timestamp_posix.o \
+export PJLIB_OBJS += $(AC_OS_OBJS) \
+ addr_resolv_sock.o \
+ log_writer_stdout.o \
+ os_timestamp_common.o \
pool_policy_malloc.o sock_bsd.o sock_select.o
-export PJLIB_OBJS += ioqueue_select.o
export PJLIB_OBJS += file_access_unistd.o file_io_ansi.o
#
diff --git a/pjlib/include/pj/compat/os_auto.h.in b/pjlib/include/pj/compat/os_auto.h.in
index 403d8919..198b940f 100644
--- a/pjlib/include/pj/compat/os_auto.h.in
+++ b/pjlib/include/pj/compat/os_auto.h.in
@@ -28,6 +28,19 @@
/* Canonical OS name */
#undef PJ_OS_NAME
+/* Legacy macros */
+#undef PJ_WIN32
+#undef PJ_WIN32_WINNT
+#undef WIN32_LEAN_AND_MEAN
+#undef PJ_DARWINOS
+#undef PJ_LINUX
+#undef PJ_RTEMS
+#undef PJ_SUNOS
+
+#if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
+# define _WIN32_WINNT PJ_WIN32_WINNT
+#endif
+
/* Headers availability */
#undef PJ_HAS_ARPA_INET_H
#undef PJ_HAS_ASSERT_H
@@ -67,6 +80,7 @@
#undef PJ_HAS_SOCKLEN_T
#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0
+# define PJ_HAS_SOCKLEN_T 1
typedef int socklen_t;
#endif
diff --git a/pjlib/include/pj/compat/socket.h b/pjlib/include/pj/compat/socket.h
index a3715e7d..e95bc125 100644
--- a/pjlib/include/pj/compat/socket.h
+++ b/pjlib/include/pj/compat/socket.h
@@ -24,14 +24,14 @@
* @brief Provides all socket related functions,data types, error codes, etc.
*/
-#if defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H != 0
-# include <winsock.h>
-#endif
-
#if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H != 0
# include <winsock2.h>
#endif
+#if defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H != 0
+# include <winsock.h>
+#endif
+
#if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H != 0
# include <sys/types.h>
#endif
@@ -124,9 +124,10 @@
/*
- * Windows specific
+ * This will finally be obsoleted, since it should be declared in
+ * os_auto.h
*/
-#if defined(PJ_WIN32) || defined(PJ_WIN32_WINCE)
+#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0
typedef int socklen_t;
#endif
diff --git a/pjlib/src/pjlib-test/ioq_unreg.c b/pjlib/src/pjlib-test/ioq_unreg.c
index d099eb1b..d6ada14b 100644
--- a/pjlib/src/pjlib-test/ioq_unreg.c
+++ b/pjlib/src/pjlib-test/ioq_unreg.c
@@ -79,7 +79,7 @@ static void on_read_complete(pj_ioqueue_key_t *key,
}
if (bytes_read < 0) {
- if (-bytes_read != PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK))
+ if (-bytes_read != PJ_STATUS_FROM_OS(PJ_BLOCKING_ERROR_VAL))
app_perror("ioqueue reported recv error", -bytes_read);
} else {
sock_data.received += bytes_read;