Am 21.03.2019 um 14:24 schrieb Jean-Marc Lasgouttes <lasgout...@lyx.org>: > > Le 21/03/2019 à 14:12, Jean-Marc Lasgouttes a écrit : >> commit 601244ba92c3975f6915455943d49c621d9487fb >> Author: Jean-Marc Lasgouttes <lasgout...@lyx.org> >> Date: Thu Mar 21 14:05:50 2019 +0100 >> Use HAVE_LONG_LONG_INT instead of LYX_USE_LONG_LONG >> It seems that the extra complication hurts more than it helps (for >> example with OpenBSD). >> Some adaptation will be needed for cmake. > > I simplified the LONG_LONG stuff. I am not sure at all why the extra > complication was added by Georg. The relevant ticket is: > https://www.lyx.org/trac/ticket/10053 > > It compiles fine with gcc on amd64, maybe because we use C++11 by default. > > Kornel, this requires some adaptation to cmake. > > If this turns out to compile on our usual targets (windows, macos and linux), > we could consider to backport this to 2.3.x.
git commit 4b2cce9e0f compiles on Mac. This includes your change. Stephan > JMarc > >> --- >> configure.ac | 10 ---------- >> src/support/convert.cpp | 4 ++-- >> src/support/convert.h | 4 ++-- >> src/support/debug.cpp | 2 +- >> src/support/debug.h | 2 +- >> src/support/docstring.cpp | 4 ++-- >> src/support/lstrings.cpp | 2 +- >> src/support/lstrings.h | 2 +- >> src/texstream.cpp | 4 ++-- >> 9 files changed, 12 insertions(+), 22 deletions(-) >> diff --git a/configure.ac b/configure.ac >> index 703d267..f4a6caf 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -123,10 +123,6 @@ AC_SUBST([HAVE_WCHAR_T]) >> # Needed for Mingw-w64 >> AC_TYPE_LONG_LONG_INT >> -if test "$ac_cv_type_long_long_int" = yes; then >> - AC_CHECK_SIZEOF(long) >> - AC_CHECK_SIZEOF(long long) >> -fi >> ### We need iconv for unicode support (Qt4 frontend requires it too) >> LYX_USE_INCLUDED_ICONV >> @@ -309,12 +305,6 @@ char * strerror(int n); >> # define USE_WCHAR_T >> #endif >> -#ifdef HAVE_LONG_LONG_INT >> -#if SIZEOF_LONG_LONG > SIZEOF_LONG >> -#define LYX_USE_LONG_LONG >> -#endif >> -#endif >> - >> #endif >> ]) >> diff --git a/src/support/convert.cpp b/src/support/convert.cpp >> index b1c554e..9455643 100644 >> --- a/src/support/convert.cpp >> +++ b/src/support/convert.cpp >> @@ -105,7 +105,7 @@ docstring convert<docstring>(unsigned long ul) >> } >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> template<> >> string convert<string>(unsigned long long ull) >> { >> @@ -135,7 +135,7 @@ docstring convert<docstring>(long l) >> } >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> template<> >> string convert<string>(long long ll) >> { >> diff --git a/src/support/convert.h b/src/support/convert.h >> index fb069c9..3b97fb6 100644 >> --- a/src/support/convert.h >> +++ b/src/support/convert.h >> @@ -33,13 +33,13 @@ template<> std::string convert<std::string>(unsigned int >> ui); >> template<> docstring convert<docstring>(unsigned int ui); >> template<> std::string convert<std::string>(unsigned long ul); >> template<> docstring convert<docstring>(unsigned long ul); >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> template<> std::string convert<std::string>(unsigned long long ull); >> template<> docstring convert<docstring>(unsigned long long ull); >> #endif >> template<> std::string convert<std::string>(long l); >> template<> docstring convert<docstring>(long l); >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> template<> std::string convert<std::string>(long long ll); >> template<> docstring convert<docstring>(long long ll); >> #endif >> diff --git a/src/support/debug.cpp b/src/support/debug.cpp >> index 3026df0..e72a43d 100644 >> --- a/src/support/debug.cpp >> +++ b/src/support/debug.cpp >> @@ -240,7 +240,7 @@ LyXErr & operator<<(LyXErr & l, long t) >> { return toStream(l, t); } >> LyXErr & operator<<(LyXErr & l, unsigned long t) >> { return toStream(l, t); } >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> LyXErr & operator<<(LyXErr & l, long long t) >> { return toStream(l, t); } >> LyXErr & operator<<(LyXErr & l, unsigned long long t) >> diff --git a/src/support/debug.h b/src/support/debug.h >> index f6b06d5..212049a 100644 >> --- a/src/support/debug.h >> +++ b/src/support/debug.h >> @@ -202,7 +202,7 @@ LyXErr & operator<<(LyXErr &, int); >> LyXErr & operator<<(LyXErr &, unsigned int); >> LyXErr & operator<<(LyXErr &, long); >> LyXErr & operator<<(LyXErr &, unsigned long); >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> LyXErr & operator<<(LyXErr &, long long); >> LyXErr & operator<<(LyXErr &, unsigned long long); >> #endif >> diff --git a/src/support/docstring.cpp b/src/support/docstring.cpp >> index 496d4c0..c53222d 100644 >> --- a/src/support/docstring.cpp >> +++ b/src/support/docstring.cpp >> @@ -514,7 +514,7 @@ protected: >> return do_put_helper(oit, b, fill, v); >> } >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> iter_type >> do_put(iter_type oit, ios_base & b, char_type fill, long long v) const >> { >> @@ -675,7 +675,7 @@ protected: >> return do_get_integer(iit, eit, b, err, v); >> } >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> iter_type >> do_get(iter_type iit, iter_type eit, ios_base & b, >> ios_base::iostate & err, long long & v) const >> diff --git a/src/support/lstrings.cpp b/src/support/lstrings.cpp >> index e69fc88..3195762 100644 >> --- a/src/support/lstrings.cpp >> +++ b/src/support/lstrings.cpp >> @@ -1475,7 +1475,7 @@ docstring bformat(docstring const & fmt, long arg1) >> } >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> docstring bformat(docstring const & fmt, long long arg1) >> { >> LATTEST(contains(fmt, from_ascii("%1$d"))); >> diff --git a/src/support/lstrings.h b/src/support/lstrings.h >> index fcf1cbb..1ff9dfd 100644 >> --- a/src/support/lstrings.h >> +++ b/src/support/lstrings.h >> @@ -360,7 +360,7 @@ docstring to_percent_encoding(docstring const & in, >> docstring const & ex = docst >> docstring bformat(docstring const & fmt, int arg1); >> docstring bformat(docstring const & fmt, long arg1); >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> docstring bformat(docstring const & fmt, long long arg1); >> #endif >> docstring bformat(docstring const & fmt, unsigned int arg1); >> diff --git a/src/texstream.cpp b/src/texstream.cpp >> index f8f298b..1523ca9 100644 >> --- a/src/texstream.cpp >> +++ b/src/texstream.cpp >> @@ -330,7 +330,7 @@ template otexrowstream & operator<< <unsigned >> int>(otexrowstream &, >> template otexrowstream & operator<< <unsigned long>(otexrowstream &, >> >> unsigned long); >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> template otexrowstream & operator<< <unsigned long long>(otexrowstream &, >> unsigned long >> long); >> #endif >> @@ -351,7 +351,7 @@ template otexstream & operator<< <double>(otexstream &, >> double); >> template otexstream & operator<< <int>(otexstream &, int); >> template otexstream & operator<< <unsigned int>(otexstream &, unsigned int); >> template otexstream & operator<< <unsigned long>(otexstream &, unsigned >> long); >> -#ifdef LYX_USE_LONG_LONG >> +#ifdef HAVE_LONG_LONG_INT >> template otexstream & operator<< <unsigned long long>(otexstream &, >> unsigned long long); >> #endif >> >