8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:40:38 +01:00

Check for the existence of the function snprintf. Added a work-around

for systems like SINIX-Z, that do not have snprintf. We really need
a plug-in replacement for those systems.
This commit is contained in:
eku 2002-08-22 11:30:32 +00:00
parent f0969257b4
commit b956e567b9
4 changed files with 22 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $Id: configure.in,v 1.34 2002-08-22 10:48:22 eku Exp $ # $Id: configure.in,v 1.35 2002-08-22 11:30:31 eku Exp $
################################# INITIALISATION ############################### ################################# INITIALISATION ###############################
@ -149,6 +149,7 @@ if test "$ac_cv_func_dirname" = "no"; then
AC_CHECK_FUNCS(dirname)],, $LIBS) AC_CHECK_FUNCS(dirname)],, $LIBS)
fi fi
AC_CHECK_FUNCS(sigaction) AC_CHECK_FUNCS(sigaction)
AC_CHECK_FUNCS(snprintf)
# Check for other things # Check for other things
AC_C_BIGENDIAN AC_C_BIGENDIAN

View File

@ -1,3 +1,5 @@
#ident "$Id: autoconfig_msvc.h,v 1.21 2002-08-22 11:30:32 eku Exp $"
/* /*
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports: * 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports:
* - MAC (MAC, MAC_AUX and "MAC_CP" defines) * - MAC (MAC, MAC_AUX and "MAC_CP" defines)
@ -59,6 +61,7 @@
#undef HAVE_TIMES #undef HAVE_TIMES
#define HAVE_DIRNAME #define HAVE_DIRNAME
#undef HAVE_SIGACTION #undef HAVE_SIGACTION
#define HAVE_SNPRINTF
/* Types */ /* Types */
#undef socklen_t #undef socklen_t

View File

@ -2221,18 +2221,32 @@ static void* intl_back_compat_obj_init_lookup(
#define snprintf _snprintf #define snprintf _snprintf
#endif #endif
/* EKU: need a replacement for snprintf for systems like SINIX-Z!!! */
switch (type) { switch (type) {
case type_texttype: case type_texttype:
#ifdef HAVE_SNPRINTF
snprintf(entry, sizeof(entry), INTL_USER_ENTRY, parm1); snprintf(entry, sizeof(entry), INTL_USER_ENTRY, parm1);
#else
sprintf(entry, INTL_USER_ENTRY, parm1);
#endif
argcount = 2; argcount = 2;
break; break;
case type_charset: case type_charset:
#ifdef HAVE_SNPRINTF
snprintf(entry, sizeof(entry), "USER_CHARSET_%03d", parm1); snprintf(entry, sizeof(entry), "USER_CHARSET_%03d", parm1);
#else
sprintf(entry, "USER_CHARSET_%03d", parm1);
#endif
argcount = 2; argcount = 2;
break; break;
case type_csconvert: case type_csconvert:
#ifdef HAVE_SNPRINTF
snprintf(entry, sizeof(entry), "USER_TRANSLATE_%03d_%03d", parm1, snprintf(entry, sizeof(entry), "USER_TRANSLATE_%03d_%03d", parm1,
parm2); parm2);
#else
sprintf(entry, "USER_TRANSLATE_%03d_%03d", parm1,
parm2);
#endif
argcount = 3; argcount = 3;
break; break;
default: default:

View File

@ -1,3 +1,5 @@
#ident "$Id: config.h.in,v 1.28 2002-08-22 11:30:32 eku Exp $"
/* /*
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports: * 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports:
* - MAC ("MAC", "MAC_AUX" and "MAC_CP" defines) * - MAC ("MAC", "MAC_AUX" and "MAC_CP" defines)
@ -49,6 +51,7 @@
#undef HAVE_TIMES #undef HAVE_TIMES
#undef HAVE_DIRNAME #undef HAVE_DIRNAME
#undef HAVE_SIGACTION #undef HAVE_SIGACTION
#undef HAVE_SNPRINTF
/* Types */ /* Types */
#undef socklen_t #undef socklen_t