Skip to content

Commit

Permalink
Merge branch 'drop-longlongwx'
Browse files Browse the repository at this point in the history
Always use wxLongLong and always use its "native" version.

See wxWidgets#24891.
  • Loading branch information
vadz committed Oct 19, 2024
2 parents 8d234aa + 55cd1c6 commit 210e8a7
Show file tree
Hide file tree
Showing 70 changed files with 313 additions and 2,909 deletions.
1 change: 0 additions & 1 deletion build/cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ wx_option(wxUSE_FSVOLUME "use wxFSVolume class")
wx_option(wxUSE_FSWATCHER "use wxFileSystemWatcher class")
wx_option(wxUSE_GEOMETRY "use geometry class")
wx_option(wxUSE_LOG "use logging system")
wx_option(wxUSE_LONGLONG "use wxLongLong class")
wx_option(wxUSE_MIMETYPE "use wxMimeTypesManager")
wx_option(wxUSE_PRINTF_POS_PARAMS "use wxVsnprintf() which supports positional parameters")
wx_option(wxUSE_SECRETSTORE "use wxSecretStore class")
Expand Down
2 changes: 0 additions & 2 deletions build/cmake/setup.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@
#cmakedefine01 wxUSE_STD_STRING_CONV_IN_WXSTRING


#cmakedefine01 wxUSE_LONGLONG

#cmakedefine01 wxUSE_BASE64

#cmakedefine01 wxUSE_CONSOLE_EVENTLOOP
Expand Down
36 changes: 0 additions & 36 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,6 @@ enable_fsvolume
enable_fswatcher
enable_geometry
enable_log
enable_longlong
enable_mimetype
enable_printfposparam
enable_secretstore
Expand Down Expand Up @@ -2161,7 +2160,6 @@ Optional Features:
--enable-fswatcher use wxFileSystemWatcher class
--enable-geometry use geometry class
--enable-log use logging system
--enable-longlong use wxLongLong class
--enable-mimetype use wxMimeTypesManager
--enable-printfposparam use wxVsnprintf() which supports positional parameters
--enable-secretstore use wxSecretStore class
Expand Down Expand Up @@ -7428,35 +7426,6 @@ fi
eval "$wx_cv_use_log"


enablestring=
defaultval=$wxUSE_ALL_FEATURES
if test -z "$defaultval"; then
if test x"$enablestring" = xdisable; then
defaultval=yes
else
defaultval=no
fi
fi

# Check whether --enable-longlong was given.
if test "${enable_longlong+set}" = set; then :
enableval=$enable_longlong;
if test "$enableval" = yes; then
wx_cv_use_longlong='wxUSE_LONGLONG=yes'
else
wx_cv_use_longlong='wxUSE_LONGLONG=no'
fi

else

wx_cv_use_longlong='wxUSE_LONGLONG=${'DEFAULT_wxUSE_LONGLONG":-$defaultval}"

fi


eval "$wx_cv_use_longlong"


enablestring=
defaultval=$wxUSE_ALL_FEATURES
if test -z "$defaultval"; then
Expand Down Expand Up @@ -37297,11 +37266,6 @@ if test "$wxUSE_LOG" = "yes"; then
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS keyboard"
fi

if test "$wxUSE_LONGLONG" = "yes"; then
$as_echo "#define wxUSE_LONGLONG 1" >>confdefs.h

fi

if test "$wxUSE_GEOMETRY" = "yes"; then
$as_echo "#define wxUSE_GEOMETRY 1" >>confdefs.h

Expand Down
5 changes: 0 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ WX_ARG_FEATURE(fsvolume, [ --enable-fsvolume use wxFSVolume class],
WX_ARG_FEATURE(fswatcher, [ --enable-fswatcher use wxFileSystemWatcher class], wxUSE_FSWATCHER)
WX_ARG_FEATURE(geometry, [ --enable-geometry use geometry class], wxUSE_GEOMETRY)
WX_ARG_FEATURE(log, [ --enable-log use logging system], wxUSE_LOG)
WX_ARG_FEATURE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG)
WX_ARG_FEATURE(mimetype, [ --enable-mimetype use wxMimeTypesManager], wxUSE_MIMETYPE)
WX_ARG_FEATURE(printfposparam,[ --enable-printfposparam use wxVsnprintf() which supports positional parameters], wxUSE_PRINTF_POS_PARAMS)
WX_ARG_FEATURE(secretstore, [ --enable-secretstore use wxSecretStore class], wxUSE_SECRETSTORE)
Expand Down Expand Up @@ -5473,10 +5472,6 @@ if test "$wxUSE_LOG" = "yes"; then
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS keyboard"
fi

if test "$wxUSE_LONGLONG" = "yes"; then
AC_DEFINE(wxUSE_LONGLONG)
fi

if test "$wxUSE_GEOMETRY" = "yes"; then
AC_DEFINE(wxUSE_GEOMETRY)
fi
Expand Down
10 changes: 3 additions & 7 deletions docs/doxygen/mainpages/const_cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,9 @@ Currently the following symbols exist:
@itemdef{wxHAS_LARGE_FFILES, Defined if wxFFile supports files more than 4GB in
size (notice that you must include @c wx/filefn.h before testing for this
symbol).}
@itemdef{wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG, Defined if compiler supports a
64 bit integer type (available as @c wxLongLong_t) and this type is
different from long. Notice that, provided wxUSE_LONGLONG is not turned
off, some 64 bit type is always available to wxWidgets programs and this
symbol only indicates a presence of such primitive type. It is useful to
decide whether some function should be overloaded for both
<code>long</code> and <code>long long</code> types.}
@itemdef{wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG, Defined if the <code>long
long</code> and <code>long</code> types are different. This can be useful
to decide whether some function should be overloaded for both types or not.}
@itemdef{wxHAS_MULTIPLE_FILEDLG_FILTERS, Defined if wxFileDialog supports multiple ('|'-separated) filters.}
@itemdef{wxHAS_NATIVE_ANIMATIONCTRL, Defined if native wxAnimationCtrl class is being used (this symbol only exists in wxWidgets 3.1.4 and later).}
@itemdef{wxHAS_NATIVE_DATAVIEWCTRL, Defined if native wxDataViewCtrl class is being used (this symbol only exists in wxWidgets 3.1.4 and later).}
Expand Down
3 changes: 0 additions & 3 deletions docs/doxygen/mainpages/const_wxusedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ This table summarizes some of the global build features affecting the entire
@itemdef{wxUSE_LOG_DIALOG, Use wxLogDialog class.}
@itemdef{wxUSE_LOGGUI, Use wxLogGui class.}
@itemdef{wxUSE_LOGWINDOW, Use wxLogFrame class.}
@itemdef{wxUSE_LONGLONG, Use wxLongLong class.}
@itemdef{wxUSE_LONGLONG_NATIVE, Use native <tt>long long</tt> type in wxLongLong implementation.}
@itemdef{wxUSE_LONGLONG_WX, Use generic wxLongLong implementation.}
@itemdef{wxUSE_MARKUP, Provide wxControl::SetLabelMarkup() method.}
@itemdef{wxUSE_MDI, Use wxMDIParentFrame, and wxMDIChildFrame}
@itemdef{wxUSE_MDI_ARCHITECTURE, Use MDI-based document-view classes.}
Expand Down
15 changes: 0 additions & 15 deletions include/wx/android/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,6 @@
// non GUI features selection
// ----------------------------------------------------------------------------

// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
#define wxUSE_LONGLONG 1

// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
// storing binary data in wxConfig on most platforms.
//
Expand Down Expand Up @@ -421,8 +408,6 @@
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
// allow to manipulate dates, times and time intervals.
//
// Requires: wxUSE_LONGLONG
//
// Default is 1
//
// Recommended setting: 1
Expand Down
18 changes: 2 additions & 16 deletions include/wx/any.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ union wxAnyValueBuffer
{
union Alignment
{
#if wxHAS_INT64
wxInt64 m_int64;
#endif
long double m_longDouble;
void ( *m_funcPtr )(void);
void ( wxAnyValueBuffer::*m_mFuncPtr )(void);
Expand Down Expand Up @@ -410,14 +408,8 @@ _WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE)\
// Integer value types
//

#ifdef wxLongLong_t
typedef wxLongLong_t wxAnyBaseIntType;
typedef wxULongLong_t wxAnyBaseUintType;
#else
typedef long wxAnyBaseIntType;
typedef unsigned long wxAnyBaseUintType;
#endif

typedef wxLongLong_t wxAnyBaseIntType;
typedef wxULongLong_t wxAnyBaseUintType;

class WXDLLIMPEXP_BASE wxAnyValueTypeImplInt :
public wxAnyValueTypeImplBase<wxAnyBaseIntType>
Expand Down Expand Up @@ -453,17 +445,13 @@ WX_ANY_DEFINE_SUB_TYPE(signed long, Int)
WX_ANY_DEFINE_SUB_TYPE(signed int, Int)
WX_ANY_DEFINE_SUB_TYPE(signed short, Int)
WX_ANY_DEFINE_SUB_TYPE(signed char, Int)
#ifdef wxLongLong_t
WX_ANY_DEFINE_SUB_TYPE(wxLongLong_t, Int)
#endif

WX_ANY_DEFINE_SUB_TYPE(unsigned long, Uint)
WX_ANY_DEFINE_SUB_TYPE(unsigned int, Uint)
WX_ANY_DEFINE_SUB_TYPE(unsigned short, Uint)
WX_ANY_DEFINE_SUB_TYPE(unsigned char, Uint)
#ifdef wxLongLong_t
WX_ANY_DEFINE_SUB_TYPE(wxULongLong_t, Uint)
#endif


//
Expand Down Expand Up @@ -916,9 +904,7 @@ class wxAny
WXANY_IMPLEMENT_INT_EQ_OP(signed short, unsigned short)
WXANY_IMPLEMENT_INT_EQ_OP(signed int, unsigned int)
WXANY_IMPLEMENT_INT_EQ_OP(signed long, unsigned long)
#ifdef wxLongLong_t
WXANY_IMPLEMENT_INT_EQ_OP(wxLongLong_t, wxULongLong_t)
#endif

wxGCC_WARNING_SUPPRESS(float-equal)

Expand Down
38 changes: 0 additions & 38 deletions include/wx/chkconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,6 @@
# endif
#endif /* !defined(wxUSE_LOG) */

#ifndef wxUSE_LONGLONG
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_LONGLONG must be defined, please read comment near the top of this file."
# else
# define wxUSE_LONGLONG 0
# endif
#endif /* !defined(wxUSE_LONGLONG) */

#ifndef wxUSE_MIMETYPE
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_MIMETYPE must be defined, please read comment near the top of this file."
Expand Down Expand Up @@ -1431,17 +1423,6 @@
# endif
#endif /* wxUSE_FS_INET */

#if wxUSE_STOPWATCH || wxUSE_DATETIME
# if !wxUSE_LONGLONG
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_STOPWATCH and wxUSE_DATETIME require wxUSE_LONGLONG"
# else
# undef wxUSE_LONGLONG
# define wxUSE_LONGLONG 1
# endif
# endif
#endif /* wxUSE_STOPWATCH */

#if wxUSE_MIMETYPE && !wxUSE_TEXTFILE
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE"
Expand Down Expand Up @@ -2333,17 +2314,6 @@
# endif
#endif /* wxUSE_PRIVATE_FONTS */

#if wxUSE_MEDIACTRL
# if !wxUSE_LONGLONG
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxMediaCtrl requires wxUSE_LONGLONG"
# else
# undef wxUSE_LONGLONG
# define wxUSE_LONGLONG 1
# endif
# endif
#endif /* wxUSE_MEDIACTRL */

#if wxUSE_STC
# if !wxUSE_STOPWATCH
# ifdef wxABORT_ON_CONFIG_ERROR
Expand Down Expand Up @@ -2373,14 +2343,6 @@
# define wxUSE_RICHTEXT 0
# endif
# endif
# if !wxUSE_LONGLONG
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxRichTextCtrl requires wxUSE_LONGLONG"
# else
# undef wxUSE_LONGLONG
# define wxUSE_LONGLONG 1
# endif
# endif
# if !wxUSE_VARIANT
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxRichTextCtrl requires wxUSE_VARIANT"
Expand Down
28 changes: 0 additions & 28 deletions include/wx/datstrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,21 @@ class WXDLLIMPEXP_BASE wxDataInputStream : public wxDataStreamBase

bool IsOk() { return m_input->IsOk(); }

#if wxHAS_INT64
wxUint64 Read64();
#endif
#if wxUSE_LONGLONG
wxLongLong ReadLL();
#endif
wxUint32 Read32();
wxUint16 Read16();
wxUint8 Read8();
double ReadDouble();
float ReadFloat();
wxString ReadString();

#if wxHAS_INT64
void Read64(wxUint64 *buffer, size_t size);
void Read64(wxInt64 *buffer, size_t size);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
void Read64(wxULongLong *buffer, size_t size);
void Read64(wxLongLong *buffer, size_t size);
#endif
#if wxUSE_LONGLONG
void ReadLL(wxULongLong *buffer, size_t size);
void ReadLL(wxLongLong *buffer, size_t size);
#endif
void Read32(wxUint32 *buffer, size_t size);
void Read16(wxUint16 *buffer, size_t size);
void Read8(wxUint8 *buffer, size_t size);
Expand All @@ -112,14 +102,10 @@ class WXDLLIMPEXP_BASE wxDataInputStream : public wxDataStreamBase
wxDataInputStream& operator>>(wxUint8& c);
wxDataInputStream& operator>>(wxUint16& i);
wxDataInputStream& operator>>(wxUint32& i);
#if wxHAS_INT64
wxDataInputStream& operator>>(wxUint64& i);
wxDataInputStream& operator>>(wxInt64& i);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxDataInputStream& operator>>(wxULongLong& i);
wxDataInputStream& operator>>(wxLongLong& i);
#endif
wxDataInputStream& operator>>(double& d);
wxDataInputStream& operator>>(float& f);

Expand All @@ -136,33 +122,23 @@ class WXDLLIMPEXP_BASE wxDataOutputStream : public wxDataStreamBase

bool IsOk() { return m_output->IsOk(); }

#if wxHAS_INT64
void Write64(wxUint64 i);
void Write64(wxInt64 i);
#endif
#if wxUSE_LONGLONG
void WriteLL(const wxLongLong &ll);
void WriteLL(const wxULongLong &ll);
#endif
void Write32(wxUint32 i);
void Write16(wxUint16 i);
void Write8(wxUint8 i);
void WriteDouble(double d);
void WriteFloat(float f);
void WriteString(const wxString& string);

#if wxHAS_INT64
void Write64(const wxUint64 *buffer, size_t size);
void Write64(const wxInt64 *buffer, size_t size);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
void Write64(const wxULongLong *buffer, size_t size);
void Write64(const wxLongLong *buffer, size_t size);
#endif
#if wxUSE_LONGLONG
void WriteLL(const wxULongLong *buffer, size_t size);
void WriteLL(const wxLongLong *buffer, size_t size);
#endif
void Write32(const wxUint32 *buffer, size_t size);
void Write16(const wxUint16 *buffer, size_t size);
void Write8(const wxUint8 *buffer, size_t size);
Expand All @@ -176,14 +152,10 @@ class WXDLLIMPEXP_BASE wxDataOutputStream : public wxDataStreamBase
wxDataOutputStream& operator<<(wxUint8 c);
wxDataOutputStream& operator<<(wxUint16 i);
wxDataOutputStream& operator<<(wxUint32 i);
#if wxHAS_INT64
wxDataOutputStream& operator<<(wxUint64 i);
wxDataOutputStream& operator<<(wxInt64 i);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxDataOutputStream& operator<<(const wxULongLong &i);
wxDataOutputStream& operator<<(const wxLongLong &i);
#endif
wxDataOutputStream& operator<<(double d);
wxDataOutputStream& operator<<(float f);

Expand Down
Loading

0 comments on commit 210e8a7

Please sign in to comment.