From 1ef58d201f4613f91a9cbafa4545f37f3fab3cf6 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sat, 18 Mar 2006 12:26:55 +0000 Subject: Added option to disable error message altogether, to save space footprint git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@330 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/errno.c | 11 ++++++----- pjlib/src/pj/os_error_win32.c | 8 ++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'pjlib') diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c index 9843105c..086bfcd7 100644 --- a/pjlib/src/pj/errno.c +++ b/pjlib/src/pj/errno.c @@ -39,6 +39,7 @@ static struct err_msg_hnd } err_msg_hnd[PJLIB_MAX_ERR_MSG_HANDLER]; /* PJLIB's own error codes/messages */ +#if defined(PJ_HAS_ERROR_STRING) && PJ_HAS_ERROR_STRING!=0 static const struct { int code; @@ -62,6 +63,8 @@ static const struct { PJ_EEXISTS, "Object already exists" }, { PJ_EEOF, "End of file" }, }; +#endif /* PJ_HAS_ERROR_STRING */ + /* * pjlib_error() @@ -70,6 +73,7 @@ static const struct */ static int pjlib_error(pj_status_t code, char *buf, pj_size_t size) { +#if defined(PJ_HAS_ERROR_STRING) && PJ_HAS_ERROR_STRING!=0 unsigned i; for (i=0; i=(start) && (val)<(end)) diff --git a/pjlib/src/pj/os_error_win32.c b/pjlib/src/pj/os_error_win32.c index 8c6d56c3..80a4eb23 100644 --- a/pjlib/src/pj/os_error_win32.c +++ b/pjlib/src/pj/os_error_win32.c @@ -33,6 +33,8 @@ /* * From Apache's APR: */ +#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) + static const struct { pj_os_err_type code; const char *msg; @@ -89,6 +91,9 @@ static const struct { {0, NULL} }; +#endif /* PJ_HAS_ERROR_STRING */ + + PJ_DEF(pj_status_t) pj_get_os_error(void) { @@ -155,6 +160,8 @@ int platform_strerror( pj_os_err_type os_errcode, #endif if (!len) { + +#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) int i; for (i = 0; gaErrorList[i].msg; ++i) { if (gaErrorList[i].code == os_errcode) { @@ -167,6 +174,7 @@ int platform_strerror( pj_os_err_type os_errcode, break; } } +#endif /* PJ_HAS_ERROR_STRING */ } else { /* Remove trailing newlines. */ -- cgit v1.2.3