summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-05-02 11:29:37 +0000
committerBenny Prijono <bennylp@teluu.com>2007-05-02 11:29:37 +0000
commit8bb2ecb06d7e994b4b5c94af831fb02c465ecb49 (patch)
treedaf006ab1fcc27244ae19cf4816d61756cab84ad /pjlib
parent67ecaf91d4e3383af948d75df8164436c7116bbc (diff)
PJSUA-LIB was ported to Symbian and added simple Symbian app. Testing follows
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1242 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/include/pj/compat/os_symbian.h2
-rw-r--r--pjlib/include/pj/config_site_sample.h12
-rw-r--r--pjlib/include/pj/except.h7
-rw-r--r--pjlib/include/pj/pool_buf.h3
-rw-r--r--pjlib/src/pj/exception_symbian.cpp38
-rw-r--r--pjlib/src/pj/os_core_symbian.cpp19
-rw-r--r--pjlib/src/pjlib-test/errno.c4
7 files changed, 40 insertions, 45 deletions
diff --git a/pjlib/include/pj/compat/os_symbian.h b/pjlib/include/pj/compat/os_symbian.h
index 51d78eb6..2871fe0a 100644
--- a/pjlib/include/pj/compat/os_symbian.h
+++ b/pjlib/include/pj/compat/os_symbian.h
@@ -145,6 +145,7 @@ typedef unsigned int socklen_t;
#include <e32def.h>
+/*
#if defined(PJ_EXPORTING)
# define PJ_EXPORT_IMPORT EXPORT_C
#elif defined(PJ_IMPORTING)
@@ -152,6 +153,7 @@ typedef unsigned int socklen_t;
#else
# error "Must define either PJ_EXPORTING or PJ_IMPORTING"
#endif
+*/
#endif /* __PJ_COMPAT_OS_SYMBIAN_H__ */
diff --git a/pjlib/include/pj/config_site_sample.h b/pjlib/include/pj/config_site_sample.h
index da67ca85..c4821de4 100644
--- a/pjlib/include/pj/config_site_sample.h
+++ b/pjlib/include/pj/config_site_sample.h
@@ -30,7 +30,19 @@
* Typical configuration for Symbian OS target
*/
#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+
+# undef PJ_HAS_FLOATING_POINT
+# define PJ_HAS_FLOATING_POINT 0
+
# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND
+# define PJMEDIA_HAS_LIBRESAMPLE 0
+# define PJMEDIA_HAS_SPEEX_AEC 0
+
+# define PJMEDIA_HAS_L16_CODEC 0
+# define PJMEDIA_HAS_GSM_CODEC 0
+# define PJMEDIA_HAS_ILBC_CODEC 0
+# define PJMEDIA_HAS_SPEEX_CODEC 0
+
#endif
diff --git a/pjlib/include/pj/except.h b/pjlib/include/pj/except.h
index 2f1f9ddd..610f4626 100644
--- a/pjlib/include/pj/except.h
+++ b/pjlib/include/pj/except.h
@@ -245,6 +245,11 @@ pj_throw_exception_(pj_exception_id_t id) PJ_ATTR_NORETURN
**
****************************************************************************/
+/* To include this file, the source file must be compiled as
+ * C++ code!
+ */
+#ifdef __cplusplus
+
class TPjException
{
public:
@@ -260,6 +265,8 @@ public:
while (0)
#define PJ_GET_EXCEPTION() pj_excp_.code_
+#endif /* __cplusplus */
+
#else
/*****************************************************************************
**
diff --git a/pjlib/include/pj/pool_buf.h b/pjlib/include/pj/pool_buf.h
index 92af2d2b..e50ee080 100644
--- a/pjlib/include/pj/pool_buf.h
+++ b/pjlib/include/pj/pool_buf.h
@@ -70,6 +70,7 @@
* @{
*/
+PJ_BEGIN_DECL
/**
* Create the pool using the specified buffer as the pool's memory.
@@ -93,6 +94,8 @@ PJ_DECL(pj_pool_t*) pj_pool_create_on_buf(const char *name,
void *buf,
pj_size_t size);
+PJ_END_DECL
+
/**
* @}
*/
diff --git a/pjlib/src/pj/exception_symbian.cpp b/pjlib/src/pj/exception_symbian.cpp
index f04045bf..1d475335 100644
--- a/pjlib/src/pj/exception_symbian.cpp
+++ b/pjlib/src/pj/exception_symbian.cpp
@@ -35,44 +35,6 @@ static long thread_local_id = -1;
#endif /* PJ_HAS_EXCEPTION_NAMES */
-//#if !defined(PJ_EXCEPTION_USE_WIN32_SEH) || PJ_EXCEPTION_USE_WIN32_SEH==0
-#if 0
-PJ_DEF(void) pj_throw_exception_(int exception_id)
-{
- struct pj_exception_state_t *handler;
-
- handler = (pj_exception_state_t*)pj_thread_local_get(thread_local_id);
- if (handler == NULL) {
- PJ_LOG(1,("except.c", "!!!FATAL: unhandled exception %d!\n", exception_id));
- pj_assert(handler != NULL);
- /* This will crash the system! */
- }
- pj_longjmp(handler->state, exception_id);
-}
-
-PJ_DEF(void) pj_push_exception_handler_(struct pj_exception_state_t *rec)
-{
- struct pj_exception_state_t *parent_handler = NULL;
-
- if (thread_local_id == -1) {
- pj_thread_local_alloc(&thread_local_id);
- pj_assert(thread_local_id != -1);
- }
- parent_handler = (pj_exception_state_t*)pj_thread_local_get(thread_local_id);
- rec->prev = parent_handler;
- pj_thread_local_set(thread_local_id, rec);
-}
-
-PJ_DEF(void) pj_pop_exception_handler_(void)
-{
- struct pj_exception_state_t *handler;
-
- handler = (pj_exception_state_t*)pj_thread_local_get(thread_local_id);
- pj_assert(handler != NULL);
- pj_thread_local_set(thread_local_id, handler->prev);
-}
-#endif
-
#if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0
PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name,
pj_exception_id_t *id)
diff --git a/pjlib/src/pj/os_core_symbian.cpp b/pjlib/src/pj/os_core_symbian.cpp
index 7386fd63..fbc30233 100644
--- a/pjlib/src/pj/os_core_symbian.cpp
+++ b/pjlib/src/pj/os_core_symbian.cpp
@@ -270,6 +270,8 @@ PJ_DECL(void) pj_shutdown(void);
*/
PJ_DEF(pj_status_t) pj_init(void)
{
+ pj_status_t status;
+
pj_ansi_strcpy(main_thread.obj_name, "pjthread");
// Init main thread
@@ -280,10 +282,17 @@ PJ_DEF(pj_status_t) pj_init(void)
PJ_LOG(4,(THIS_FILE, "Initializing PJLIB for Symbian OS.."));
- TInt err;
+ TInt err;
err = os->Initialize();
if (err != KErrNone)
goto on_error;
+
+ /* Initialize exception ID for the pool.
+ * Must do so after critical section is configured.
+ */
+ status = pj_exception_id_alloc("PJLIB/No memory", &PJ_NO_MEMORY_EXCEPTION);
+ if (status != PJ_SUCCESS)
+ return status;
PJ_LOG(5,(THIS_FILE, "PJLIB initialized."));
return PJ_SUCCESS;
@@ -307,13 +316,11 @@ PJ_DEF(pj_status_t) pj_atexit(void (*func)(void))
PJ_DEF(void) pj_shutdown(void)
{
- unsigned i;
-
/* Call atexit() functions */
- for (i=atexit_count-1; i>=0; --i) {
- (*atexit_func[i])();
+ while (atexit_count > 0) {
+ (*atexit_func[atexit_count-1])();
+ --atexit_count;
}
- atexit_count = 0;
/* Free exception ID */
if (PJ_NO_MEMORY_EXCEPTION != -1) {
diff --git a/pjlib/src/pjlib-test/errno.c b/pjlib/src/pjlib-test/errno.c
index fd06af35..33378fea 100644
--- a/pjlib/src/pjlib-test/errno.c
+++ b/pjlib/src/pjlib-test/errno.c
@@ -70,11 +70,13 @@ const char *my_stristr(const char *whole, const char *part)
int errno_test(void)
{
enum { CUT = 6 };
- pj_status_t rc;
+ pj_status_t rc = 0;
char errbuf[256];
PJ_LOG(3,(THIS_FILE, "...errno test: check the msg carefully"));
+ PJ_UNUSED_ARG(rc);
+
/*
* Windows platform error.
*/