Symbian fixes to compile on GCCE (nested callbacks etc)

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1269 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjlib/include/pj/compat/cc_armcc.h b/pjlib/include/pj/compat/cc_armcc.h
index 504ca88..52fe74c 100644
--- a/pjlib/include/pj/compat/cc_armcc.h
+++ b/pjlib/include/pj/compat/cc_armcc.h
@@ -33,8 +33,12 @@
 #define PJ_CC_VER_2		__ARMCC_MINOR__
 #define PJ_CC_VER_3		__ARMCC_PATCHLEVEL__
 
+#ifdef __cplusplus
+#  define PJ_INLINE_SPECIFIER	inline
+#else
+#  define PJ_INLINE_SPECIFIER	static __inline
+#endif
 
-#define PJ_INLINE_SPECIFIER	static // why is not inline accepted?
 #define PJ_THREAD_FUNC	
 #define PJ_NORETURN		
 #define PJ_ATTR_NORETURN	__attribute__ ((noreturn))
diff --git a/pjlib/include/pj/compat/os_symbian.h b/pjlib/include/pj/compat/os_symbian.h
index b1b1cd1..f6787b0 100644
--- a/pjlib/include/pj/compat/os_symbian.h
+++ b/pjlib/include/pj/compat/os_symbian.h
@@ -144,7 +144,9 @@
 #define PJ_HAS_SOCKLEN_T		1
 typedef unsigned int socklen_t;
 
+#ifndef __GCCE__
 #include <e32def.h>
+#endif
 
 /*
 #if defined(PJ_EXPORTING)
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h
index cd5d916..df6c1b0 100644
--- a/pjlib/include/pj/errno.h
+++ b/pjlib/include/pj/errno.h
@@ -111,6 +111,7 @@
 PJ_DECL(pj_str_t) pj_strerror( pj_status_t statcode, 
 			       char *buf, pj_size_t bufsize);
 
+typedef pj_str_t (*pjsip_error_callback)(pj_status_t, char*, pj_size_t);
 /**
  * Register strerror message handler for the specified error space.
  * Application can register its own handler to supply the error message
@@ -132,8 +133,7 @@
  */
 PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
 					  pj_status_t err_space,
-					  pj_str_t (*f)(pj_status_t,char*,
-							pj_size_t));
+					  pjsip_error_callback f);
 
 /**
  * @hideinitializer
diff --git a/pjlib/include/pj/except.h b/pjlib/include/pj/except.h
index 610f462..509b01b 100644
--- a/pjlib/include/pj/except.h
+++ b/pjlib/include/pj/except.h
@@ -26,6 +26,7 @@
 
 #include <pj/types.h>
 #include <pj/compat/setjmp.h>
+#include <pj/log.h>
 
 
 PJ_BEGIN_DECL
@@ -265,6 +266,15 @@
 				while (0)
 #define PJ_GET_EXCEPTION()	pj_excp_.code_
 
+#else
+
+#define PJ_USE_EXCEPTION
+#define PJ_TRY				
+#define PJ_CATCH_ANY		if (0)
+#define PJ_END
+#define PJ_THROW(x_id)		do { PJ_LOG(1,("PJ_THROW"," error code = %d",x_id)); } while (0)
+#define PJ_GET_EXCEPTION()	0
+
 #endif	/* __cplusplus */
 
 #else
diff --git a/pjlib/include/pj/types.h b/pjlib/include/pj/types.h
index 7b7598b..e909552 100644
--- a/pjlib/include/pj/types.h
+++ b/pjlib/include/pj/types.h
@@ -302,6 +302,7 @@
  */
 PJ_DECL(void) pj_shutdown(void);
 
+typedef void (*pj_exit_callback)(void);
 /**
  * Register cleanup function to be called by PJLIB when pj_shutdown() is 
  * called.
@@ -310,7 +311,7 @@
  *
  * @return PJ_SUCCESS on success.
  */
-PJ_DECL(pj_status_t) pj_atexit(void (*func)(void));
+PJ_DECL(pj_status_t) pj_atexit(pj_exit_callback func);