summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/m-x86_64.mak4
-rwxr-xr-xconfigure2
-rw-r--r--pjlib/include/pj/compat/m_x86_64.h35
-rw-r--r--pjlib/include/pj/config.h2
-rw-r--r--pjlib/src/pj/ioqueue_common_abs.c4
-rw-r--r--pjlib/src/pj/pool_caching.c4
-rw-r--r--pjmedia/build/m-x86_64.mak6
-rw-r--r--pjsip-apps/src/samples/pjsip-perf.c21
-rw-r--r--pjsip/src/pjsip/sip_transport_udp.c4
-rw-r--r--pjsip/src/pjsip/sip_ua_layer.c20
-rw-r--r--pjsip/src/test-pjsip/msg_test.c6
-rw-r--r--pjsip/src/test-pjsip/transport_loop_test.c2
-rw-r--r--pjsip/src/test-pjsip/transport_tcp_test.c2
-rw-r--r--pjsip/src/test-pjsip/transport_test.c4
-rw-r--r--pjsip/src/test-pjsip/transport_udp_test.c2
-rw-r--r--pjsip/src/test-pjsip/uri_test.c6
16 files changed, 91 insertions, 33 deletions
diff --git a/build/m-x86_64.mak b/build/m-x86_64.mak
new file mode 100644
index 00000000..5e847e9c
--- /dev/null
+++ b/build/m-x86_64.mak
@@ -0,0 +1,4 @@
+export M_CFLAGS := $(CC_DEF)PJ_M_X86_64=1
+export M_CXXFLAGS :=
+export M_LDFLAGS :=
+export M_SOURCES :=
diff --git a/configure b/configure
index 0464a135..4e16315e 100755
--- a/configure
+++ b/configure
@@ -11,6 +11,8 @@ if echo $MACHINE | grep sun4u > /dev/null; then
MACHINE_NAME=sparc
elif echo $MACHINE | grep i.86 > /dev/null; then
MACHINE_NAME=i386
+elif echo $MACHINE | grep x86_64 > /dev/null; then
+ MACHINE_NAME=x86_64
elif echo $MACHINE | grep alpha > /dev/null; then
MACHINE_NAME=alpha
elif echo $MACHINE | grep Mac > /dev/null; then
diff --git a/pjlib/include/pj/compat/m_x86_64.h b/pjlib/include/pj/compat/m_x86_64.h
new file mode 100644
index 00000000..e1e33935
--- /dev/null
+++ b/pjlib/include/pj/compat/m_x86_64.h
@@ -0,0 +1,35 @@
+/* $Id$ */
+/*
+ * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __PJ_COMPAT_M_x86_64_H__
+#define __PJ_COMPAT_M_x86_64_H__
+
+/**
+ * @file m_i386.h
+ * @brief Describes 64bit x86 Intel/AMD family processor specifics.
+ */
+
+#define PJ_M_NAME "x86_64"
+
+#define PJ_HAS_PENTIUM 1
+#define PJ_IS_LITTLE_ENDIAN 1
+#define PJ_IS_BIG_ENDIAN 0
+
+
+#endif /* __PJ_COMPAT_M_x86_64_H__ */
+
diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
index 1d74d8c7..251f7f7b 100644
--- a/pjlib/include/pj/config.h
+++ b/pjlib/include/pj/config.h
@@ -65,6 +65,8 @@
*/
#if defined (PJ_M_I386) && PJ_M_I386 != 0
# include <pj/compat/m_i386.h>
+#elif defined (PJ_M_X86_64) && PJ_M_X86_64 != 0
+# include <pj/compat/m_x86_64.h>
#elif defined (PJ_M_M68K) && PJ_M_M68K != 0
# include <pj/compat/m_m68k.h>
#elif defined (PJ_M_ALPHA) && PJ_M_ALPHA != 0
diff --git a/pjlib/src/pj/ioqueue_common_abs.c b/pjlib/src/pj/ioqueue_common_abs.c
index 5356f91d..be562fa7 100644
--- a/pjlib/src/pj/ioqueue_common_abs.c
+++ b/pjlib/src/pj/ioqueue_common_abs.c
@@ -208,7 +208,7 @@ void ioqueue_dispatch_write_event(pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h)
*/
{
int value;
- socklen_t vallen = sizeof(value);
+ int vallen = sizeof(value);
int gs_rc = pj_sock_getsockopt(h->fd, SOL_SOCKET, SO_ERROR,
&value, &vallen);
if (gs_rc != 0) {
@@ -528,7 +528,7 @@ void ioqueue_dispatch_exception_event( pj_ioqueue_t *ioqueue,
pj_status_t status = -1;
#if (defined(PJ_HAS_SO_ERROR) && PJ_HAS_SO_ERROR!=0)
int value;
- socklen_t vallen = sizeof(value);
+ int vallen = sizeof(value);
int gs_rc = pj_sock_getsockopt(h->fd, SOL_SOCKET, SO_ERROR,
&value, &vallen);
if (gs_rc == 0) {
diff --git a/pjlib/src/pj/pool_caching.c b/pjlib/src/pj/pool_caching.c
index e0eecd4d..192bf380 100644
--- a/pjlib/src/pj/pool_caching.c
+++ b/pjlib/src/pj/pool_caching.c
@@ -175,7 +175,7 @@ static pj_pool_t* cpool_create_pool(pj_pool_factory *pf,
pj_list_insert_before( &cp->used_list, pool );
/* Mark factory data */
- pool->factory_data = (void*) idx;
+ pool->factory_data = (void*) (long) idx;
/* Increment used count. */
++cp->used_count;
@@ -225,7 +225,7 @@ static void cpool_release_pool( pj_pool_factory *pf, pj_pool_t *pool)
/*
* Otherwise put the pool in our recycle list.
*/
- i = (unsigned)pool->factory_data;
+ i = (unsigned) (unsigned long) pool->factory_data;
pj_assert(i<PJ_CACHING_POOL_ARRAY_SIZE);
if (i >= PJ_CACHING_POOL_ARRAY_SIZE ) {
diff --git a/pjmedia/build/m-x86_64.mak b/pjmedia/build/m-x86_64.mak
new file mode 100644
index 00000000..304a295f
--- /dev/null
+++ b/pjmedia/build/m-x86_64.mak
@@ -0,0 +1,6 @@
+
+#
+# We need to define PA_LITTLE_ENDIAN when compiling PortAudio on Linux x86_64
+#
+
+export M_CFLAGS += $(CC_DEF)PA_LITTLE_ENDIAN
diff --git a/pjsip-apps/src/samples/pjsip-perf.c b/pjsip-apps/src/samples/pjsip-perf.c
index 777fbe75..6c1f7290 100644
--- a/pjsip-apps/src/samples/pjsip-perf.c
+++ b/pjsip-apps/src/samples/pjsip-perf.c
@@ -504,10 +504,13 @@ static pj_bool_t mod_responder_on_rx_request(pjsip_rx_data *rdata)
const pj_str_t reason = pj_str("Not expecting request at this URI");
/*
- * Respond any requests with 500.
+ * Respond any requests (except ACK!) with 500.
*/
- pjsip_endpt_respond_stateless(app.sip_endpt, rdata, 500, &reason,
- NULL, NULL);
+ if (rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) {
+ pjsip_endpt_respond_stateless(app.sip_endpt, rdata, 500, &reason,
+ NULL, NULL);
+ }
+
return PJ_TRUE;
}
@@ -1313,7 +1316,7 @@ static pj_status_t submit_job(void)
static int client_thread(void *arg)
{
pj_time_val end_time, last_report, now;
- unsigned thread_index = (unsigned)arg;
+ unsigned thread_index = (unsigned)(long)arg;
unsigned cycle = 0, last_cycle = 0;
pj_thread_sleep(100);
@@ -1470,7 +1473,7 @@ static const char *good_number(char *buf, pj_int32_t val)
static int server_thread(void *arg)
{
pj_time_val timeout = { 0, 1 };
- unsigned thread_index = (unsigned)arg;
+ unsigned thread_index = (unsigned)(long)arg;
pj_time_val last_report, next_report;
pj_gettimeofday(&last_report);
@@ -1606,8 +1609,8 @@ int main(int argc, char *argv[])
app.client.job_window);
for (i=0; i<app.thread_count; ++i) {
- status = pj_thread_create(app.pool, NULL, &client_thread, (void*)i,
- 0, 0, &app.thread[i]);
+ status = pj_thread_create(app.pool, NULL, &client_thread,
+ (void*)(long)i, 0, 0, &app.thread[i]);
if (status != PJ_SUCCESS) {
app_perror(THIS_FILE, "Unable to create thread", status);
return 1;
@@ -1715,8 +1718,8 @@ int main(int argc, char *argv[])
printf("INVITE with non-matching user part will be handled call-statefully\n");
for (i=0; i<app.thread_count; ++i) {
- status = pj_thread_create(app.pool, NULL, &server_thread, (void*)i,
- 0, 0, &app.thread[i]);
+ status = pj_thread_create(app.pool, NULL, &server_thread,
+ (void*)(long)i, 0, 0, &app.thread[i]);
if (status != PJ_SUCCESS) {
app_perror(THIS_FILE, "Unable to create thread", status);
return 1;
diff --git a/pjsip/src/pjsip/sip_transport_udp.c b/pjsip/src/pjsip/sip_transport_udp.c
index 5bcd454d..d0c6c307 100644
--- a/pjsip/src/pjsip/sip_transport_udp.c
+++ b/pjsip/src/pjsip/sip_transport_udp.c
@@ -86,7 +86,7 @@ static void init_rdata(struct udp_transport *tp, unsigned rdata_index,
/* Init tp_info part. */
rdata->tp_info.pool = pool;
rdata->tp_info.transport = &tp->base;
- rdata->tp_info.tp_data = (void*) rdata_index;
+ rdata->tp_info.tp_data = (void*)(long)rdata_index;
rdata->tp_info.op_key.rdata = rdata;
pj_ioqueue_op_key_init(&rdata->tp_info.op_key.op_key,
sizeof(pj_ioqueue_op_key_t));
@@ -190,7 +190,7 @@ static void udp_on_read_complete( pj_ioqueue_key_t *key,
unsigned rdata_index;
rdata_tp = (struct udp_transport*)rdata->tp_info.transport;
- rdata_index = (unsigned)rdata->tp_info.tp_data;
+ rdata_index = (unsigned)(unsigned long)rdata->tp_info.tp_data;
pj_pool_reset(rdata_pool);
init_rdata(rdata_tp, rdata_index, rdata_pool, &rdata);
diff --git a/pjsip/src/pjsip/sip_ua_layer.c b/pjsip/src/pjsip/sip_ua_layer.c
index a38825eb..2010dace 100644
--- a/pjsip/src/pjsip/sip_ua_layer.c
+++ b/pjsip/src/pjsip/sip_ua_layer.c
@@ -539,13 +539,19 @@ static pj_bool_t mod_ua_on_rx_request(pjsip_rx_data *rdata)
/* Not found. Mulfunction UAC? */
pj_mutex_unlock(mod_ua.mutex);
- PJ_LOG(5,(THIS_FILE,
- "Unable to find dialog for %s, answering with 481",
- pjsip_rx_data_get_info(rdata)));
-
- pjsip_endpt_respond_stateless(mod_ua.endpt, rdata,
- PJSIP_SC_CALL_TSX_DOES_NOT_EXIST,
- NULL, NULL, NULL);
+ if (rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) {
+ PJ_LOG(5,(THIS_FILE,
+ "Unable to find dialog for %s, answering with 481",
+ pjsip_rx_data_get_info(rdata)));
+
+ pjsip_endpt_respond_stateless(mod_ua.endpt, rdata,
+ PJSIP_SC_CALL_TSX_DOES_NOT_EXIST,
+ NULL, NULL, NULL);
+ } else {
+ PJ_LOG(5,(THIS_FILE,
+ "Unable to find dialog for %s",
+ pjsip_rx_data_get_info(rdata)));
+ }
return PJ_TRUE;
}
diff --git a/pjsip/src/test-pjsip/msg_test.c b/pjsip/src/test-pjsip/msg_test.c
index d0039047..6954f015 100644
--- a/pjsip/src/test-pjsip/msg_test.c
+++ b/pjsip/src/test-pjsip/msg_test.c
@@ -818,7 +818,7 @@ int msg_test(void)
"can be pre-parse by <tt>pjsip_find_msg()</tt> "
"per second (tested with %d message sets with "
"average message length of "
- "%d bytes)", PJ_ARRAY_SIZE(test_array), avg_len);
+ "%d bytes)", (int)PJ_ARRAY_SIZE(test_array), avg_len);
report_ival("msg-detect-per-sec", max, "msg/sec", desc);
/* Print maximum parse/sec */
@@ -831,7 +831,7 @@ int msg_test(void)
"can be <b>parsed</b> by <tt>pjsip_parse_msg()</tt> "
"per second (tested with %d message sets with "
"average message length of "
- "%d bytes)", PJ_ARRAY_SIZE(test_array), avg_len);
+ "%d bytes)", (int)PJ_ARRAY_SIZE(test_array), avg_len);
report_ival("msg-parse-per-sec", max, "msg/sec", desc);
/* Msg parsing bandwidth */
@@ -851,7 +851,7 @@ int msg_test(void)
"can be <b>printed</b> by <tt>pjsip_msg_print()</tt>"
" per second (tested with %d message sets with "
"average message length of "
- "%d bytes)", PJ_ARRAY_SIZE(test_array), avg_len);
+ "%d bytes)", (int)PJ_ARRAY_SIZE(test_array), avg_len);
report_ival("msg-print-per-sec", max, "msg/sec", desc);
diff --git a/pjsip/src/test-pjsip/transport_loop_test.c b/pjsip/src/test-pjsip/transport_loop_test.c
index 3e378832..c2c122ec 100644
--- a/pjsip/src/test-pjsip/transport_loop_test.c
+++ b/pjsip/src/test-pjsip/transport_loop_test.c
@@ -31,7 +31,7 @@ static int datagram_loop_test()
pj_sockaddr_in addr;
pj_status_t status;
long ref_cnt;
- unsigned rtt[LOOP], min_rtt;
+ int rtt[LOOP], min_rtt;
PJ_LOG(3,(THIS_FILE, "testing datagram loop transport"));
diff --git a/pjsip/src/test-pjsip/transport_tcp_test.c b/pjsip/src/test-pjsip/transport_tcp_test.c
index 70f1bc92..c3578ee6 100644
--- a/pjsip/src/test-pjsip/transport_tcp_test.c
+++ b/pjsip/src/test-pjsip/transport_tcp_test.c
@@ -35,7 +35,7 @@ int transport_tcp_test(void)
pj_sockaddr_in rem_addr;
pj_status_t status;
char url[64];
- unsigned rtt[SEND_RECV_LOOP], min_rtt;
+ int rtt[SEND_RECV_LOOP], min_rtt;
int i, pkt_lost;
/* Start TCP listener on arbitrary port. */
diff --git a/pjsip/src/test-pjsip/transport_test.c b/pjsip/src/test-pjsip/transport_test.c
index 2d84efea..e5baa040 100644
--- a/pjsip/src/test-pjsip/transport_test.c
+++ b/pjsip/src/test-pjsip/transport_test.c
@@ -489,7 +489,7 @@ static void rt_tx_timer( pj_timer_heap_t *timer_heap,
static int rt_worker_thread(void *arg)
{
- int i, thread_id = (int)arg;
+ int i, thread_id = (int)(long)arg;
pj_time_val poll_delay = { 0, 10 };
/* Sleep to allow main threads to run. */
@@ -576,7 +576,7 @@ int transport_rt_test( pjsip_transport_type_e tp_type,
}
/* Create thread, suspended. */
- status = pj_thread_create(pool, "rttest%p", &rt_worker_thread, (void*)i, 0,
+ status = pj_thread_create(pool, "rttest%p", &rt_worker_thread, (void*)(long)i, 0,
PJ_THREAD_SUSPENDED, &rt_test_data[i].thread);
if (status != PJ_SUCCESS) {
app_perror(" error: unable to create thread", status);
diff --git a/pjsip/src/test-pjsip/transport_udp_test.c b/pjsip/src/test-pjsip/transport_udp_test.c
index 34bb02c4..d24d862e 100644
--- a/pjsip/src/test-pjsip/transport_udp_test.c
+++ b/pjsip/src/test-pjsip/transport_udp_test.c
@@ -34,7 +34,7 @@ int transport_udp_test(void)
pj_sockaddr_in addr, rem_addr;
pj_str_t s;
pj_status_t status;
- unsigned rtt[SEND_RECV_LOOP], min_rtt;
+ int rtt[SEND_RECV_LOOP], min_rtt;
int i, pkt_lost;
pj_sockaddr_in_init(&addr, NULL, TEST_UDP_PORT);
diff --git a/pjsip/src/test-pjsip/uri_test.c b/pjsip/src/test-pjsip/uri_test.c
index a0fc1fb2..da3c1833 100644
--- a/pjsip/src/test-pjsip/uri_test.c
+++ b/pjsip/src/test-pjsip/uri_test.c
@@ -955,7 +955,7 @@ int uri_test(void)
"<tt>pjsip_parse_uri()</tt> per second "
"(tested with %d URI set, with average length of "
"%d chars)",
- PJ_ARRAY_SIZE(uri_test_array), avg_len);
+ (int)PJ_ARRAY_SIZE(uri_test_array), avg_len);
report_ival("uri-parse-per-sec", max, "URI/sec", desc);
@@ -975,7 +975,7 @@ int uri_test(void)
"<tt>pjsip_uri_print()</tt> per second "
"(tested with %d URI set, with average length of "
"%d chars)",
- PJ_ARRAY_SIZE(uri_test_array), avg_len);
+ (int)PJ_ARRAY_SIZE(uri_test_array), avg_len);
report_ival("uri-print-per-sec", max, "URI/sec", desc);
@@ -989,7 +989,7 @@ int uri_test(void)
"<tt>pjsip_uri_cmp()</tt> per second "
"(tested with %d URI set, with average length of "
"%d chars)",
- PJ_ARRAY_SIZE(uri_test_array), avg_len);
+ (int)PJ_ARRAY_SIZE(uri_test_array), avg_len);
report_ival("uri-cmp-per-sec", max, "URI/sec", desc);