+1999-12-28 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * src/buffer.C (Dispatch): remove an extraneous break statement.
+
+ * acinclude.m4 (STL_STRING_FWD_H_LOCATION): add the comment for
+ config.h.in to the AC_DEFINE_UNQUOTED() call.
+ (LYX_FUNC_PUTENV_ARGTYPE): new macro. Checks whether putenv()
+ needs char * as argument (because Solaris 7 declares it like
+ that).
+
+ * acconfig.h: remove placeholder for STL_STRING_FWD_H_LOCATION;
+ remove definition of BZERO.
+
+ * src/support/filetools.C (QuoteName): change to do simple
+ 'quoting'. More work is necessary. Also changed to do nothing
+ under emx (needs fix too).
+
1999-12-24 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/support/LRegex.C: include <regex.h> if HAVE_REGEX_H is
/* Define as 1 if you have the stpcopy function */
#undef HAVE_STPCPY
-/* define this to the location of stl_string_fwd.h to be used with #include,
- NOTE: Do not set it to <stl_string_fwd.h> as that will find the LyX
- supplied version of the header.
- e.g. <../include/stl_string_fwd.h> or better yet use an absolute path */
-#undef STL_STRING_FWD_H_LOCATION
-
/* define this to the location of xpm.h to be used with #include,
e.g. <xpm.h> */
#undef XPM_H_LOCATION
/**/#undef __STRICT_ANSI__
#endif
-#ifdef HAVE_MEMSET
-#define BZERO(a,b) memset(a,0,b)
-#else
-#define BZERO(a,b) bzero(a,b)
-#endif
-
#ifndef HAVE_STRCHR
#define strchr(a,b) index(a,b)
#endif
test "x$GXX" = xyes && lyx_broken_headers=yes
fi])
+dnl Usage: LYX_FUNC_PUTENV_ARGTYPE
+dnl Checks whether putenv() takes 'char const *' or 'char *' as
+dnl argument. This is needed because Solaris 7 (wrongly?) uses 'char *',
+dnl while everybody else uses the former...
+AC_DEFUN(LYX_FUNC_PUTENV_ARGTYPE,
+[AC_MSG_CHECKING([type of argument for putenv()])
+ AC_CACHE_VAL(lyx_cv_func_putenv_arg,dnl
+ [AC_TRY_COMPILE(dnl
+[#include <cstdlib>
+extern int putenv(const char *);],,dnl
+ [lyx_cv_func_putenv_arg='char const *'],[lyx_cv_func_putenv_arg='char *'])])
+ AC_MSG_RESULT($lyx_cv_func_putenv_arg)
+ AC_DEFINE_UNQUOTED(PUTENV_TYPE_ARG,$lyx_cv_func_putenv_arg,dnl
+ [Define to the type of the argument of putenv(). Needed on Solaris 7.])])
+
dnl Usage: LYX_WITH_DIR(dir-name,desc,dir-var-name,default-value,
dnl [default-yes-value])
ac_cv_target_system_type="$target"
])
-
dnl We use this until autoconf fixes its version.
AC_DEFUN(LYX_FUNC_SELECT_ARGTYPES,
[AC_MSG_CHECKING([types of arguments for select()])
grep 'stl_string_fwd.h' 2>/dev/null | \
sed -e 's/.*\(".*stl_string_fwd.h"\).*/\1/' -e "1q"`
rm -f conftest*])
- AC_DEFINE_UNQUOTED(STL_STRING_FWD_H_LOCATION,$lyx_cv_path_stl_string_fwd_h)])
+ AC_DEFINE_UNQUOTED(STL_STRING_FWD_H_LOCATION,$lyx_cv_path_stl_string_fwd_h,
+[define this to the location of stl_string_fwd.h to be used with #include,
+ NOTE: Do not set it to <stl_string_fwd.h> as that will find the LyX
+ supplied version of the header.
+ e.g. <../include/stl_string_fwd.h> or better yet use an absolute path])])
])
dnl Until this is fixed in autoconf we provide our own version
LYX_FUNC_SELECT_ARGTYPES
+dnl check whether we have to work around solaris broken putenv()
+LYX_FUNC_PUTENV_ARGTYPE
+
# SunOS 4.1.3 does not have strerror and atexit
AC_REPLACE_FUNCS(strerror atexit)
case LFUN_EXPORT:
MenuExport(this, argument);
break;
- break;
default:
lyxerr << "A truly unknown func!" << endl;
#ifdef WITH_WARNINGS
#warning Add proper emx support here!
#endif
- string qname = name;
- while (qname.find("'") != string::npos)
- LSubstring(qname, "'") = "\\'";
- return '\'' + qname + '\'';
+#ifndef __EMX__
+ return '\'' + name + '\'';
+#else
+ return name;
+#endif
}
// this leaks, but what can we do about it?
// Is doing a getenv() and a free() of the older value
// a good idea? (JMarc)
- int retval = putenv((new string(envstr))->c_str());
+ int retval = putenv(const_cast<PUTENV_TYPE_ARG>((new string(envstr))->c_str()));
#else
#ifdef HAVE_SETENV
string varname;