- add check for strrev and implementation if not found

This commit is contained in:
Christophe Bothamy 2003-01-10 22:32:46 +00:00
parent 5840618ceb
commit e6ff0a8560
5 changed files with 112 additions and 6 deletions

View File

@ -669,6 +669,9 @@ typedef
// limited i440FX PCI support
#define BX_PCI_SUPPORT 0
// Experimental VGA on PCI
#define BX_PCI_VGA_SUPPORT 1
// Promise VLBIDE DC2300 Support
#define BX_PDC20230C_VLBIDE_SUPPORT 0
@ -760,6 +763,7 @@ typedef
#define BX_HAVE_STRTOULL 0
#define BX_HAVE_STRTOUQ 0
#define BX_HAVE_STRDUP 0
#define BX_HAVE_STRREV 0
#define BX_HAVE_STRUCT_TIMEVAL 0
#define BX_HAVE_COLOR_SET 0 // used in term gui

83
bochs/configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Id: configure.in,v 1.195 2002/12/26 18:24:40 vruppert Exp .
# From configure.in Id: configure.in,v 1.196 2003/01/04 19:22:47 bdenney Exp .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53.
#
@ -13955,6 +13955,85 @@ fi
done
for ac_func in strrev
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func ();
char (*f) ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
f = $ac_func;
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define BX_HAVE_STRREV 1
_ACEOF
fi
done
for ac_func in sleep
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@ -19363,7 +19442,7 @@ echo "${ECHO_T}yes" >&6
#define BX_PCI_SUPPORT 1
_ACEOF
PCI_OBJ='pci.o pci2isa.o'
PCI_OBJ='pci.o pci2isa.o pcivga.o'
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

View File

@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(bochs.h)
AC_REVISION([[$Id: configure.in,v 1.196 2003-01-04 19:22:47 bdenney Exp $]])
AC_REVISION([[$Id: configure.in,v 1.197 2003-01-10 22:32:38 cbothamy Exp $]])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(ltdlconf.h)
@ -139,6 +139,7 @@ AC_CHECK_FUNCS(snprintf, AC_DEFINE(BX_HAVE_SNPRINTF))
AC_CHECK_FUNCS(strtoull, AC_DEFINE(BX_HAVE_STRTOULL))
AC_CHECK_FUNCS(strtouq, AC_DEFINE(BX_HAVE_STRTOUQ))
AC_CHECK_FUNCS(strdup, AC_DEFINE(BX_HAVE_STRDUP))
AC_CHECK_FUNCS(strrev, AC_DEFINE(BX_HAVE_STRREV))
AC_CHECK_FUNCS(sleep, AC_DEFINE(BX_HAVE_SLEEP))
AC_CHECK_FUNCS(usleep, AC_DEFINE(BX_HAVE_USLEEP))
AC_CHECK_FUNCS(nanosleep, AC_DEFINE(BX_HAVE_NANOSLEEP))
@ -757,7 +758,7 @@ AC_ARG_ENABLE(pci,
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_PCI_SUPPORT, 1)
PCI_OBJ='pci.o pci2isa.o'
PCI_OBJ='pci.o pci2isa.o pcivga.o'
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_PCI_SUPPORT, 0)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: osdep.cc,v 1.11 2002-12-12 15:29:33 cbothamy Exp $
// $Id: osdep.cc,v 1.12 2003-01-10 22:32:44 cbothamy Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -218,6 +218,23 @@ char *bx_strdup(const char *str)
}
#endif /* !BX_HAVE_STRDUP */
#if !BX_HAVE_STRREV
char *bx_strrev(char *str)
{
char *p1, *p2;
if (! str || ! *str)
return str;
for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2) {
*p1 ^= *p2;
*p2 ^= *p1;
*p1 ^= *p2;
}
return str;
}
#endif /* !BX_HAVE_STRREV */
//////////////////////////////////////////////////////////////////////
// Missing library functions, implemented for MacOS only
//////////////////////////////////////////////////////////////////////

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: osdep.h,v 1.14 2002-12-12 15:29:39 cbothamy Exp $
// $Id: osdep.h,v 1.15 2003-01-10 22:32:46 cbothamy Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -97,6 +97,11 @@ extern "C" {
extern char *bx_strdup(const char *str);
#endif
#if !BX_HAVE_STRREV
#define strrev bx_strrev
extern char *bx_strrev(char *str);
#endif
#if !BX_HAVE_SOCKLEN_T
// needed on MacOS X 10.1
typedef int socklen_t;