Index: /pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 1158)
+++ /pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 1159)
@@ -156,4 +156,5 @@
     return !pj_list_empty(&key->accept_list);
 #else
+    PJ_UNUSED_ARG(key);
     return 0;
 #endif
Index: /pjproject/trunk/pjlib/src/pj/ioqueue_select.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/ioqueue_select.c	(revision 1158)
+++ /pjproject/trunk/pjlib/src/pj/ioqueue_select.c	(revision 1159)
@@ -557,6 +557,8 @@
     else if (event_type == WRITEABLE_EVENT)
         PJ_FD_CLR((pj_sock_t)key->fd, &ioqueue->wfdset);
+#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0
     else if (event_type == EXCEPTION_EVENT)
         PJ_FD_CLR((pj_sock_t)key->fd, &ioqueue->xfdset);
+#endif
     else
         pj_assert(0);
@@ -581,6 +583,8 @@
     else if (event_type == WRITEABLE_EVENT)
         PJ_FD_SET((pj_sock_t)key->fd, &ioqueue->wfdset);
+#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0
     else if (event_type == EXCEPTION_EVENT)
         PJ_FD_SET((pj_sock_t)key->fd, &ioqueue->xfdset);
+#endif
     else
         pj_assert(0);
@@ -650,6 +654,9 @@
      */
     if (PJ_FD_COUNT(&ioqueue->rfdset)==0 &&
-        PJ_FD_COUNT(&ioqueue->wfdset)==0 &&
-        PJ_FD_COUNT(&ioqueue->xfdset)==0)
+        PJ_FD_COUNT(&ioqueue->wfdset)==0 
+#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0
+        && PJ_FD_COUNT(&ioqueue->xfdset)==0
+#endif
+	)
     {
 #if PJ_IOQUEUE_HAS_SAFE_UNREG
Index: /pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c	(revision 1158)
+++ /pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c	(revision 1159)
@@ -367,5 +367,7 @@
 PJ_DEF(pj_status_t) pj_ioqueue_destroy( pj_ioqueue_t *ioqueue )
 {
+#if PJ_HAS_TCP
     unsigned i;
+#endif
     pj_ioqueue_key_t *key;
 
@@ -740,5 +742,7 @@
 {
     DWORD dwMsec;
+#if PJ_HAS_TCP
     int connect_count = 0;
+#endif
     int event_count = 0;
 
Index: /pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c	(revision 1158)
+++ /pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c	(revision 1159)
@@ -772,5 +772,7 @@
 	    addrname.port = app.local_port;
 
-	if (app.use_tcp) {
+	if (0) {
+#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0
+	} else if (app.use_tcp) {
 	    pj_sockaddr_in local_addr;
 	    pjsip_tpfactory *tpfactory;
@@ -784,4 +786,5 @@
 		app.local_port = tpfactory->addr_name.port;
 	    }
+#endif
 	} else {
 	    pjsip_transport *tp;
Index: /pjproject/trunk/pjsip-apps/src/samples/sipstateless.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/samples/sipstateless.c	(revision 1158)
+++ /pjproject/trunk/pjsip-apps/src/samples/sipstateless.c	(revision 1159)
@@ -37,5 +37,5 @@
 
 /* If this macro is set, TCP transport will be initialized at port 5060 */
-#define HAS_TCP_TRANSPORT
+#define HAS_TCP_TRANSPORT   (1 && PJ_HAS_TCP)
 
 /* Log identification */
@@ -142,5 +142,5 @@
 #endif
 
-#ifdef HAS_TCP_TRANSPORT
+#if HAS_TCP_TRANSPORT
     /* 
      * Add UDP transport, with hard-coded port 
Index: /pjproject/trunk/pjsip/include/pjsip/sip_transport_tcp.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsip/sip_transport_tcp.h	(revision 1158)
+++ /pjproject/trunk/pjsip/include/pjsip/sip_transport_tcp.h	(revision 1159)
@@ -26,4 +26,9 @@
 
 #include <pjsip/sip_transport.h>
+
+
+/* Only declare the API if PJ_HAS_TCP is true */
+#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0
+
 
 PJ_BEGIN_DECL
@@ -113,3 +118,5 @@
  */
 
+#endif	/* PJ_HAS_TCP */
+
 #endif	/* __PJSIP_TRANSPORT_TCP_H__ */
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 1158)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 1159)
@@ -30,4 +30,7 @@
 #include <pj/string.h>
 
+/* Only declare the API if PJ_HAS_TCP is true */
+#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0
+
 
 #define THIS_FILE	"sip_transport_tcp.c"
@@ -1366,2 +1369,4 @@
 }
 
+#endif	/* PJ_HAS_TCP */
+
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 1158)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 1159)
@@ -1192,4 +1192,6 @@
 	pjsua_var.tpdata[id].data.tp = tp;
 
+#if defined(PJ_HAS_TCP) && PJ_HAS_TCP!=0
+
     } else if (type == PJSIP_TRANSPORT_TCP) {
 	/*
@@ -1242,4 +1244,6 @@
 	pjsua_var.tpdata[id].local_name = tcp->addr_name;
 	pjsua_var.tpdata[id].data.factory = tcp;
+
+#endif	/* PJ_HAS_TCP */
 
 #if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0
Index: /pjproject/trunk/pjsip/src/test-pjsip/test.c
===================================================================
--- /pjproject/trunk/pjsip/src/test-pjsip/test.c	(revision 1158)
+++ /pjproject/trunk/pjsip/src/test-pjsip/test.c	(revision 1159)
@@ -227,6 +227,8 @@
     unsigned i;
     pjsip_transport *tp;
+#if PJ_HAS_TCP
     pjsip_tpfactory *tpfactory;
-#endif
+#endif	/* PJ_HAS_TCP */
+#endif	/* INCLUDE_TSX_TEST */
     int line;
 
@@ -332,4 +334,5 @@
     }
 
+#if PJ_HAS_TCP
     status = pjsip_tcp_transport_start(endpt, NULL, 1, &tpfactory);
     if (status == PJ_SUCCESS) {
@@ -343,4 +346,5 @@
 	goto on_return;
     }
+#endif
 
 
Index: /pjproject/trunk/pjsip/src/test-pjsip/transport_tcp_test.c
===================================================================
--- /pjproject/trunk/pjsip/src/test-pjsip/transport_tcp_test.c	(revision 1158)
+++ /pjproject/trunk/pjsip/src/test-pjsip/transport_tcp_test.c	(revision 1159)
@@ -28,4 +28,5 @@
  * TCP transport test.
  */
+#if PJ_HAS_TCP
 int transport_tcp_test(void)
 {
@@ -142,2 +143,8 @@
     return 0;
 }
+#else	/* PJ_HAS_TCP */
+int transport_tcp_test(void)
+{
+    return 0;
+}
+#endif	/* PJ_HAS_TCP */
