summaryrefslogtreecommitdiff
path: root/pjlib/src
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/src
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/src')
-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
3 files changed, 16 insertions, 45 deletions
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.
*/