diff options
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/include/pj/compat/os_symbian.h | 2 | ||||
-rw-r--r-- | pjlib/include/pj/config_site_sample.h | 12 | ||||
-rw-r--r-- | pjlib/include/pj/except.h | 7 | ||||
-rw-r--r-- | pjlib/include/pj/pool_buf.h | 3 | ||||
-rw-r--r-- | pjlib/src/pj/exception_symbian.cpp | 38 | ||||
-rw-r--r-- | pjlib/src/pj/os_core_symbian.cpp | 19 | ||||
-rw-r--r-- | pjlib/src/pjlib-test/errno.c | 4 |
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. */ |