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-util/src/pjlib-util/errno.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pjlib-util') diff --git a/pjlib-util/src/pjlib-util/errno.c b/pjlib-util/src/pjlib-util/errno.c index b5e43e7a..bce785ae 100644 --- a/pjlib-util/src/pjlib-util/errno.c +++ b/pjlib-util/src/pjlib-util/errno.c @@ -25,6 +25,7 @@ * MUST KEEP THIS ARRAY SORTED!! * Message must be limited to 64 chars! */ +#if defined(PJ_HAS_ERROR_STRING) && PJ_HAS_ERROR_STRING!=0 static const struct { int code; @@ -47,7 +48,7 @@ static const struct /* XML errors */ { PJLIB_UTIL_EINXML, "Invalid XML message" }, }; - +#endif /* PJ_HAS_ERROR_STRING */ /* @@ -58,6 +59,8 @@ PJ_DEF(pj_str_t) pjlib_util_strerror( pj_status_t statcode, { pj_str_t errstr; +#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING != 0) + if (statcode >= PJLIB_UTIL_ERRNO_START && statcode < PJLIB_UTIL_ERRNO_START + PJ_ERRNO_SPACE_SIZE) { @@ -96,10 +99,13 @@ PJ_DEF(pj_str_t) pjlib_util_strerror( pj_status_t statcode, } } +#endif /* PJ_HAS_ERROR_STRING */ + + /* Error not found. */ errstr.ptr = buf; errstr.slen = pj_ansi_snprintf(buf, bufsize, - "Unknown error %d", + "Unknown pjlib-util error %d", statcode); return errstr; -- cgit v1.2.3