more things are done by configure: checks for bool, whether overloading based
on size_t/int works or not (for wxString), the type of 3rd argument to getsockaddr, absence of libXpm is not fatal (not tested), whether strings.h exists git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
222
configure.in
222
configure.in
@@ -452,43 +452,40 @@ if test "$ac_cv_header_linux_joystick_h" = "yes"; then
|
|||||||
fi
|
fi
|
||||||
AC_SUBST(GTK_JOYSTICK)
|
AC_SUBST(GTK_JOYSTICK)
|
||||||
|
|
||||||
|
dnl some systems (AIX) define some of string function in strings.h
|
||||||
|
AC_CHECK_HEADERS(strings.h)
|
||||||
|
|
||||||
|
dnl #######################
|
||||||
|
dnl # check for functions #
|
||||||
|
dnl #######################
|
||||||
|
|
||||||
dnl check for vprintf/vsprintf() which are GNU extensions
|
dnl check for vprintf/vsprintf() which are GNU extensions
|
||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
|
|
||||||
dnl check for several standard functions we use if they are available
|
dnl check for vsnprintf() - a safe version of vsprintf()
|
||||||
AC_CHECK_FUNCS(vsnprintf vfork)
|
AC_CHECK_FUNCS(vsnprintf,
|
||||||
|
AC_DEFINE(HAVE_VSNPRINTF),
|
||||||
|
AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
|
||||||
|
)
|
||||||
|
|
||||||
|
dnl check for vfork() (even if it's the same as fork() in modern Unices)
|
||||||
|
AC_CHECK_FUNCS(vfork)
|
||||||
|
|
||||||
POSIX4_LINK=
|
POSIX4_LINK=
|
||||||
dnl check for usleep() and nanosleep() which is better in MT programs
|
AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP), [
|
||||||
dnl AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP),
|
AC_CHECK_LIB(posix4, nanosleep, [
|
||||||
dnl [
|
AC_DEFINE(HAVE_NANOSLEEP)
|
||||||
dnl AC_CHECK_LIB(posix4, nanosleep,
|
POSIX4_LINK="-lposix4"
|
||||||
dnl AC_DEFINE(HAVE_NANOSLEEP),
|
], [
|
||||||
dnl AC_CHECK_FUNCS(usleep))
|
AC_CHECK_FUNCS(usleep,
|
||||||
dnl ]
|
AC_DEFINE(HAVE_USLEEP),
|
||||||
dnl )
|
AC_MSG_WARN(Sleep() function will not work))
|
||||||
AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP),
|
])
|
||||||
[AC_CHECK_LIB(posix4, nanosleep, [
|
])
|
||||||
AC_DEFINE(HAVE_NANOSLEEP)
|
|
||||||
POSIX4_LINK="-lposix4" ],
|
|
||||||
[AC_CHECK_FUNCS(usleep, AC_DEFINE(HAVE_USLEEP),
|
|
||||||
AC_MSG_WARN(Sleep() function will not work)
|
|
||||||
)]
|
|
||||||
)]
|
|
||||||
)
|
|
||||||
|
|
||||||
dnl check for uname (POSIX) and gethostname (BSD)
|
dnl check for uname (POSIX) and gethostname (BSD)
|
||||||
AC_CHECK_FUNCS(uname gethostname, break)
|
AC_CHECK_FUNCS(uname gethostname, break)
|
||||||
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_CHECK_HEADERS(iostream)
|
|
||||||
if test "x$HAVE_IOSTREAM" = "x" ; then
|
|
||||||
AC_DEFINE(wxUSE_IOSTREAMH)
|
|
||||||
fi
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
|
|
||||||
dnl defines HAVE_IOSTREAM
|
|
||||||
dnl ###################
|
dnl ###################
|
||||||
dnl # checks typedefs #
|
dnl # checks typedefs #
|
||||||
dnl ###################
|
dnl ###################
|
||||||
@@ -533,7 +530,6 @@ dnl defines HAVE_TZNAME if external array tzname is found
|
|||||||
dnl ###################################
|
dnl ###################################
|
||||||
dnl # checks compiler characteristics #
|
dnl # checks compiler characteristics #
|
||||||
dnl ###################################
|
dnl ###################################
|
||||||
dnl AC_C_CROSS
|
|
||||||
|
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
dnl defines const to be empty if c-compiler does not support const fully
|
dnl defines const to be empty if c-compiler does not support const fully
|
||||||
@@ -547,11 +543,12 @@ dnl defines HAVE_LONGDOUBLE if compiler supports long double
|
|||||||
AC_C_BIGENDIAN
|
AC_C_BIGENDIAN
|
||||||
dnl defines WORDS_BIGENDIAN if system is big endian
|
dnl defines WORDS_BIGENDIAN if system is big endian
|
||||||
|
|
||||||
AC_CHECK_SIZEOF(int *)
|
dnl give some default values for cross-compiling
|
||||||
AC_CHECK_SIZEOF(int)
|
AC_CHECK_SIZEOF(int *, 4)
|
||||||
AC_CHECK_SIZEOF(long)
|
AC_CHECK_SIZEOF(int, 4)
|
||||||
AC_CHECK_SIZEOF(long long)
|
AC_CHECK_SIZEOF(long, 4)
|
||||||
dnl defines the size of certain types of variables in SIZEOF_???
|
AC_CHECK_SIZEOF(long long, 0)
|
||||||
|
dnl defines the size of certain types of variables in SIZEOF_<TYPE>
|
||||||
|
|
||||||
dnl ######################
|
dnl ######################
|
||||||
dnl # check C++ features #
|
dnl # check C++ features #
|
||||||
@@ -560,15 +557,55 @@ dnl ######################
|
|||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CPLUSPLUS
|
||||||
|
|
||||||
|
dnl check for iostream (as opposed to iostream.h) standard header
|
||||||
|
AC_CHECK_HEADERS(iostream)
|
||||||
|
if test "x$HAVE_IOSTREAM" = "x" ; then
|
||||||
|
AC_DEFINE(wxUSE_IOSTREAMH)
|
||||||
|
fi
|
||||||
|
|
||||||
dnl Check for existence of builtin 'bool' data type
|
dnl Check for existence of builtin 'bool' data type
|
||||||
dnl
|
dnl
|
||||||
dnl do nothing for cross-compilation - assume bool is not defined
|
dnl do nothing for cross-compilation - assume bool is not defined
|
||||||
AC_MSG_CHECKING(if C++ compiler supports bool)
|
AC_MSG_CHECKING(if C++ compiler supports bool)
|
||||||
AC_TRY_RUN([ int main() {bool b = true; return 0;} ],
|
AC_TRY_RUN([
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
bool b = true;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
],
|
||||||
AC_DEFINE(HAVE_BOOL) AC_MSG_RESULT(yes),
|
AC_DEFINE(HAVE_BOOL) AC_MSG_RESULT(yes),
|
||||||
AC_MSG_RESULT(no),
|
AC_MSG_RESULT(no),
|
||||||
AC_MSG_RESULT(no assumed for cross-compilation))
|
AC_MSG_RESULT(no assumed for cross-compilation))
|
||||||
|
|
||||||
|
dnl Check whether overloading on size_t/int parameter works
|
||||||
|
AC_MSG_CHECKING(if size_t and int are different types)
|
||||||
|
AC_TRY_RUN([
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void wxFoo(int i) { }
|
||||||
|
void wxFoo(size_t n) { }
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
size_t n;
|
||||||
|
wxFoo(0);
|
||||||
|
wxFoo(1);
|
||||||
|
wxFoo(0u);
|
||||||
|
wxFoo(i);
|
||||||
|
wxFoo(n);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
AC_DEFINE(wxUSE_SIZE_T_STRING_OPERATOR) AC_MSG_RESULT(yes),
|
||||||
|
AC_MSG_RESULT(no),
|
||||||
|
AC_MSG_RESULT(no assumed for cross-compilation))
|
||||||
|
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
|
|
||||||
dnl ############################
|
dnl ############################
|
||||||
@@ -1100,49 +1137,60 @@ if test "$wxUSE_QT" = 1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$wxUSE_MOTIF" = 1; then
|
if test "$wxUSE_MOTIF" = 1; then
|
||||||
AC_MSG_CHECKING(for Motif/Lesstif includes)
|
AC_MSG_CHECKING(for Motif/Lesstif includes)
|
||||||
AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,Xm/Xm.h)
|
AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
|
||||||
if test "$ac_find_includes" != "" ; then
|
if test "$ac_find_includes" != "" ; then
|
||||||
AC_MSG_RESULT(found $ac_find_includes)
|
AC_MSG_RESULT(found $ac_find_includes)
|
||||||
AC_MSG_CHECKING(for Motif/Lesstif library)
|
else
|
||||||
AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xm)
|
AC_MSG_RESULT(no)
|
||||||
if test "$ac_find_libraries" != "" ; then
|
AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h)
|
||||||
AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
|
fi
|
||||||
AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
|
|
||||||
CHECK_LINK="$CHECK_LIB $ac_path_to_link"
|
|
||||||
CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
|
|
||||||
AC_MSG_RESULT(found at $ac_find_libraries)
|
|
||||||
AC_MSG_CHECKING(for Xt library)
|
|
||||||
AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt)
|
|
||||||
if test "$ac_find_libraries" != "" ; then
|
|
||||||
AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
|
|
||||||
CHECK_LINK="$CHECK_LIB $ac_path_to_link"
|
|
||||||
AC_MSG_RESULT(found at $ac_find_libraries)
|
|
||||||
AC_MSG_CHECKING(for Xpm library)
|
|
||||||
AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
|
|
||||||
if test "$ac_find_libraries" != "" ; then
|
|
||||||
AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
|
|
||||||
CHECK_LINK="$CHECK_LIB $ac_path_to_link"
|
|
||||||
AC_MSG_RESULT(found at $ac_find_libraries)
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR(no)
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR(no)
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR(no)
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR(no)
|
|
||||||
fi
|
|
||||||
|
|
||||||
GUI_TK_LINK="-lXm -lXpm -lXmu -lXt -lX11 -lm"
|
AC_MSG_CHECKING(for Motif/Lesstif library)
|
||||||
GUI_TK_LIBRARY="$CHECK_LIB $GUI_TK_LINK"
|
AC_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
|
||||||
TOOLKIT=MOTIF
|
if test "$ac_find_libraries" != "" ; then
|
||||||
TOOLKIT_DEF=__WXMOTIF__
|
AC_INCLUDE_PATH_EXIST($ac_find_includes, $CHECK_INCLUDE)
|
||||||
WX_LINK=-lwx_motif2
|
AC_LINK_PATH_EXIST($ac_find_libraries, $CHECK_LIB)
|
||||||
MAKEINCLUDE=../motif.inc
|
|
||||||
|
CHECK_LINK="$CHECK_LIB $ac_path_to_link"
|
||||||
|
CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
|
||||||
|
AC_MSG_RESULT(found at $ac_find_libraries)
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for Xt library)
|
||||||
|
AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt)
|
||||||
|
if test "$ac_find_libraries" != "" ; then
|
||||||
|
AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
|
||||||
|
CHECK_LINK="$CHECK_LIB $ac_path_to_link"
|
||||||
|
AC_MSG_RESULT(found at $ac_find_libraries)
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_ERROR(please set LDFLAGS to contain the location of libXt)
|
||||||
|
fi
|
||||||
|
|
||||||
|
XPM_LINK=""
|
||||||
|
AC_MSG_CHECKING(for Xpm library)
|
||||||
|
AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
|
||||||
|
if test "$ac_find_libraries" != "" ; then
|
||||||
|
AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
|
||||||
|
CHECK_LINK="$CHECK_LIB $ac_path_to_link"
|
||||||
|
XPM_LINK="-lXpm "
|
||||||
|
AC_DEFINE(wxHAVE_LIB_XPM)
|
||||||
|
AC_MSG_RESULT(found at $ac_find_libraries)
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_WARN(library will be compiled without support for images in XPM format)
|
||||||
|
fi
|
||||||
|
|
||||||
|
GUI_TK_LINK="-lXm " $XPM_LINK "-lXmu -lXt -lX11 -lm"
|
||||||
|
GUI_TK_LIBRARY="$CHECK_LIB $GUI_TK_LINK"
|
||||||
|
TOOLKIT=MOTIF
|
||||||
|
TOOLKIT_DEF=__WXMOTIF__
|
||||||
|
WX_LINK=-lwx_motif2
|
||||||
|
MAKEINCLUDE=../motif.inc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$TOOLKIT" = ""; then
|
if test "$TOOLKIT" = ""; then
|
||||||
@@ -1290,6 +1338,26 @@ if test "$wxUSE_SERIAL" = 1 ; then
|
|||||||
AC_DEFINE_UNQUOTED(wxUSE_SERIAL,$wxUSE_SERIAL)
|
AC_DEFINE_UNQUOTED(wxUSE_SERIAL,$wxUSE_SERIAL)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl ------------------------------------------------------------------------
|
||||||
|
dnl wxSocket
|
||||||
|
dnl ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if test "$wxUSE_SOCKETS" = "1"; then
|
||||||
|
dnl determine the type of third argument for getsockname
|
||||||
|
AC_MSG_CHECKING(the type of the third argument of getsockname)
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <sys/socket.h>],
|
||||||
|
[size_t len; getsockname(0, NULL, &len);],
|
||||||
|
AC_DEFINE(SOCKLEN_T, size_t) AC_MSG_RESULT(size_t),
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <sys/socket.h>],
|
||||||
|
[int len; getsockname(0, NULL, &len);],
|
||||||
|
AC_DEFINE(SOCKLEN_T, int) AC_MSG_RESULT(int),
|
||||||
|
AC_MSG_RESULT(unknown)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
dnl ------------------------------------------------------------------------
|
dnl ------------------------------------------------------------------------
|
||||||
dnl wxLibrary class
|
dnl wxLibrary class
|
||||||
dnl ------------------------------------------------------------------------
|
dnl ------------------------------------------------------------------------
|
||||||
|
@@ -141,6 +141,14 @@
|
|||||||
#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXSTUBS__]"
|
#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXSTUBS__]"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// non portable C++ features
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// check for native bool type and TRUE/FALSE constants
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXSTUBS__)
|
#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXSTUBS__)
|
||||||
// Bool is now obsolete, use bool instead
|
// Bool is now obsolete, use bool instead
|
||||||
// typedef int Bool;
|
// typedef int Bool;
|
||||||
@@ -157,43 +165,35 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif // TRUE/FALSE
|
#endif // TRUE/FALSE
|
||||||
|
|
||||||
// VC++ 4.0 is 1000.
|
// Add more tests here for Windows compilers that already define bool
|
||||||
|
// (under Unix, configure tests for this)
|
||||||
|
#ifndef HAVE_BOOL
|
||||||
|
#if defined( __MWERKS__ )
|
||||||
|
#if (__MWERKS__ >= 0x1000) && !__option(bool)
|
||||||
|
#define HAVE_BOOL
|
||||||
|
#endif
|
||||||
|
#elif defined(__VISUALC__) && (__VISUALC__ == 1020)
|
||||||
|
// in VC++ 4.2 the bool keyword is reserved (hence can't be typedefed)
|
||||||
|
// but not implemented, so we must #define it
|
||||||
|
#define bool unsigned int
|
||||||
|
#elif defined(__VISUALC__) && (__VISUALC__ > 1020)
|
||||||
|
// VC++ supports bool since 4.2
|
||||||
|
#define HAVE_BOOL
|
||||||
|
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)
|
||||||
|
// Borland 5.0+ supports bool
|
||||||
|
#define HAVE_BOOL
|
||||||
|
#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
|
||||||
|
// Watcom 11+ supports bool
|
||||||
|
#define HAVE_BOOL
|
||||||
|
#endif // compilers
|
||||||
|
#endif // HAVE_BOOL
|
||||||
|
|
||||||
// Add more tests here for compilers that don't already define bool.
|
#if !defined(HAVE_BOOL) && !defined(bool)
|
||||||
#if defined( __MWERKS__ )
|
// NB: of course, this doesn't replace the standard type, because, for
|
||||||
#if (__MWERKS__ < 0x1000) || !__option(bool)
|
// example, overloading based on bool/int parameter doesn't work and
|
||||||
typedef unsigned int bool;
|
// so should be avoided in portable programs
|
||||||
#endif
|
|
||||||
#elif defined(__SC__)
|
|
||||||
typedef unsigned int bool;
|
typedef unsigned int bool;
|
||||||
#elif defined(__SALFORDC__)
|
#endif // bool
|
||||||
typedef unsigned int bool;
|
|
||||||
#elif defined(__VISUALC__) && (__VISUALC__ <= 1000)
|
|
||||||
typedef unsigned int bool;
|
|
||||||
#elif defined(__VISUALC__) && (__VISUALC__ == 1020)
|
|
||||||
#define bool unsigned int
|
|
||||||
#elif defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
|
|
||||||
typedef unsigned int bool;
|
|
||||||
#elif defined(__WATCOMC__)
|
|
||||||
#if (__WATCOMC__ < 1100)
|
|
||||||
typedef unsigned int bool;
|
|
||||||
#endif
|
|
||||||
#elif defined(__SUNCC__) || defined(__SUNPRO_CC)
|
|
||||||
#ifdef __SUNPRO_CC
|
|
||||||
// starting from version 5.0 Sun CC understands 'bool'
|
|
||||||
#if __SUNPRO_CC <= 0x0420
|
|
||||||
// If we use int, we get identically overloaded functions in config.cpp
|
|
||||||
typedef unsigned char bool;
|
|
||||||
#endif // Sun CC version
|
|
||||||
#else
|
|
||||||
#error "Unknown compiler: only Sun's CC and gcc are currently recognised."
|
|
||||||
#endif // Sun CC
|
|
||||||
#elif defined(__SGI_CC__)
|
|
||||||
// test is taken from SGI "C++ Programming Guide"
|
|
||||||
#ifndef _BOOL
|
|
||||||
typedef unsigned char bool;
|
|
||||||
#endif // _BOOL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef unsigned char wxByte;
|
typedef unsigned char wxByte;
|
||||||
typedef short int WXTYPE;
|
typedef short int WXTYPE;
|
||||||
@@ -201,9 +201,9 @@ typedef int wxWindowID;
|
|||||||
|
|
||||||
// Macro to cut down on compiler warnings.
|
// Macro to cut down on compiler warnings.
|
||||||
#if REMOVE_UNUSED_ARG
|
#if REMOVE_UNUSED_ARG
|
||||||
#define WXUNUSED(identifier) /* identifier */
|
#define WXUNUSED(identifier) /* identifier */
|
||||||
#else // stupid, broken compiler
|
#else // stupid, broken compiler
|
||||||
#define WXUNUSED(identifier) identifier
|
#define WXUNUSED(identifier) identifier
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -212,26 +212,6 @@ typedef int wxWindowID;
|
|||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
|
|
||||||
/*
|
|
||||||
#ifdef __BORLANDC__
|
|
||||||
|
|
||||||
# ifdef WXMAKINGDLL
|
|
||||||
# define WXDLLEXPORT __export
|
|
||||||
# define WXDLLEXPORT_DATA(type) type __export
|
|
||||||
# define WXDLLEXPORT_CTORFN __export
|
|
||||||
# elif defined(WXUSINGDLL)
|
|
||||||
# define WXDLLEXPORT __import
|
|
||||||
# define WXDLLEXPORT_DATA(type) type __import
|
|
||||||
# define WXDLLEXPORT_CTORFN
|
|
||||||
# else
|
|
||||||
# define WXDLLEXPORT
|
|
||||||
# define WXDLLEXPORT_DATA(type) type
|
|
||||||
# define WXDLLEXPORT_CTORFN
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
*/
|
|
||||||
|
|
||||||
// _declspec works in BC++ 5 and later, as well as VC++
|
// _declspec works in BC++ 5 and later, as well as VC++
|
||||||
#if defined(__VISUALC__) || defined(__BORLANDC__)
|
#if defined(__VISUALC__) || defined(__BORLANDC__)
|
||||||
|
|
||||||
@@ -255,12 +235,11 @@ typedef int wxWindowID;
|
|||||||
# define WXDLLEXPORT_CTORFN
|
# define WXDLLEXPORT_CTORFN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else // !Windows
|
||||||
// Non-Windows
|
|
||||||
# define WXDLLEXPORT
|
# define WXDLLEXPORT
|
||||||
# define WXDLLEXPORT_DATA(type) type
|
# define WXDLLEXPORT_DATA(type) type
|
||||||
# define WXDLLEXPORT_CTORFN
|
# define WXDLLEXPORT_CTORFN
|
||||||
#endif
|
#endif // Win/!Win
|
||||||
|
|
||||||
// For ostream, istream ofstream
|
// For ostream, istream ofstream
|
||||||
#if defined(__BORLANDC__) && defined( _RTLDLL )
|
#if defined(__BORLANDC__) && defined( _RTLDLL )
|
||||||
@@ -276,27 +255,6 @@ class WXDLLEXPORT wxEvent;
|
|||||||
integer on success as failure indicator */
|
integer on success as failure indicator */
|
||||||
#define wxNOT_FOUND (-1)
|
#define wxNOT_FOUND (-1)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// Error codes
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifdef ERR_PARAM
|
|
||||||
#undef ERR_PARAM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Standard error codes
|
|
||||||
enum ErrCode
|
|
||||||
{
|
|
||||||
/// invalid parameter (in broad sense)
|
|
||||||
ERR_PARAM = (-4000),
|
|
||||||
/// no more data (iteration functions usually return this)
|
|
||||||
ERR_NODATA,
|
|
||||||
/// user cancelled the operation
|
|
||||||
ERR_CANCEL,
|
|
||||||
/// no error (the only non negative error code)
|
|
||||||
ERR_SUCCESS = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
/** @name Very common macros */
|
/** @name Very common macros */
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef __AIX__
|
#ifdef HAVE_STRINGS_H
|
||||||
#include <strings.h> // for strcasecmp()
|
#include <strings.h> // for strcasecmp()
|
||||||
#endif // AIX
|
#endif // AIX
|
||||||
|
|
||||||
@@ -320,8 +320,10 @@ public:
|
|||||||
char& Last()
|
char& Last()
|
||||||
{ wxASSERT( !IsEmpty() ); CopyBeforeWrite(); return m_pchData[Len()-1]; }
|
{ wxASSERT( !IsEmpty() ); CopyBeforeWrite(); return m_pchData[Len()-1]; }
|
||||||
|
|
||||||
// on Linux-Alpha and AIX this gives overload problems
|
// under Unix it is tested with configure, assume it works on other
|
||||||
#if !(defined(__ALPHA__) || defined(__AIX__))
|
// platforms (there might be overloading problems if size_t and int are
|
||||||
|
// the same type)
|
||||||
|
#if !defined(__UNIX__) || defined(wxUSE_SIZE_T_STRING_OPERATOR)
|
||||||
// operator version of GetChar
|
// operator version of GetChar
|
||||||
char operator[](size_t n) const
|
char operator[](size_t n) const
|
||||||
{ ASSERT_VALID_INDEX( n ); return m_pchData[n]; }
|
{ ASSERT_VALID_INDEX( n ); return m_pchData[n]; }
|
||||||
|
@@ -79,7 +79,9 @@ public:
|
|||||||
wxVariant();
|
wxVariant();
|
||||||
wxVariant(double val, const wxString& name = g_szNul);
|
wxVariant(double val, const wxString& name = g_szNul);
|
||||||
wxVariant(long val, const wxString& name = g_szNul);
|
wxVariant(long val, const wxString& name = g_szNul);
|
||||||
|
#ifdef HAVE_BOOL
|
||||||
wxVariant(bool val, const wxString& name = g_szNul);
|
wxVariant(bool val, const wxString& name = g_szNul);
|
||||||
|
#endif
|
||||||
wxVariant(char val, const wxString& name = g_szNul);
|
wxVariant(char val, const wxString& name = g_szNul);
|
||||||
wxVariant(const wxString& val, const wxString& name = g_szNul);
|
wxVariant(const wxString& val, const wxString& name = g_szNul);
|
||||||
wxVariant(const char* val, const wxString& name = g_szNul); // Necessary or VC++ assumes bool!
|
wxVariant(const char* val, const wxString& name = g_szNul); // Necessary or VC++ assumes bool!
|
||||||
@@ -114,9 +116,11 @@ public:
|
|||||||
bool operator== (char value) const;
|
bool operator== (char value) const;
|
||||||
bool operator!= (char value) const;
|
bool operator!= (char value) const;
|
||||||
void operator= (char value) ;
|
void operator= (char value) ;
|
||||||
|
#ifdef HAVE_BOOL
|
||||||
bool operator== (bool value) const;
|
bool operator== (bool value) const;
|
||||||
bool operator!= (bool value) const;
|
bool operator!= (bool value) const;
|
||||||
void operator= (bool value) ;
|
void operator= (bool value) ;
|
||||||
|
#endif
|
||||||
bool operator== (const wxString& value) const;
|
bool operator== (const wxString& value) const;
|
||||||
bool operator!= (const wxString& value) const;
|
bool operator!= (const wxString& value) const;
|
||||||
void operator= (const wxString& value) ;
|
void operator= (const wxString& value) ;
|
||||||
|
@@ -72,6 +72,10 @@
|
|||||||
* Have glibc2
|
* Have glibc2
|
||||||
*/
|
*/
|
||||||
#define wxHAVE_GLIBC2 0
|
#define wxHAVE_GLIBC2 0
|
||||||
|
/*
|
||||||
|
* Use libXpm
|
||||||
|
*/
|
||||||
|
#define wxHAVE_LIB_XPM 0
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
/* GUI control options (always enabled in wxGTK) */
|
/* GUI control options (always enabled in wxGTK) */
|
||||||
@@ -168,6 +172,13 @@
|
|||||||
*/
|
*/
|
||||||
#define wxUSE_WCSRTOMBS 0
|
#define wxUSE_WCSRTOMBS 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* On some platforms overloading on size_t/int doesn't work, yet we'd like
|
||||||
|
* to define both size_t and int version of wxString::operator[] because it
|
||||||
|
* should really be size_t, but a lot of old, broken code uses int indices.
|
||||||
|
*/
|
||||||
|
#define wxUSE_SIZE_T_STRING_OPERATOR 1
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
/* misc options */
|
/* misc options */
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
@@ -353,6 +364,9 @@
|
|||||||
Usually this is either `int' or `gid_t'. */
|
Usually this is either `int' or `gid_t'. */
|
||||||
#undef GETGROUPS_T
|
#undef GETGROUPS_T
|
||||||
|
|
||||||
|
/* The type of 3rd argument to getsockname() - usually size_t or int */
|
||||||
|
#undef SOCKLEN_T
|
||||||
|
|
||||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||||
#undef GETLOADAVG_PRIVILEGED
|
#undef GETLOADAVG_PRIVILEGED
|
||||||
|
|
||||||
@@ -374,6 +388,9 @@
|
|||||||
/* Define if you have sched.h */
|
/* Define if you have sched.h */
|
||||||
#undef HAVE_SCHED_H
|
#undef HAVE_SCHED_H
|
||||||
|
|
||||||
|
/* Define if you have strings.h */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
/* Define if you have vprintf() */
|
/* Define if you have vprintf() */
|
||||||
#undef HAVE_VPRINTF
|
#undef HAVE_VPRINTF
|
||||||
|
|
||||||
|
@@ -73,23 +73,24 @@ void wxMacProcessEvents() ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#endif // __WINDOWS__
|
#endif // __WINDOWS__
|
||||||
|
|
||||||
#if defined(__UNIX__)
|
#if defined(__UNIX__)
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
#include <socket.h>
|
#include <socket.h>
|
||||||
#else
|
#else // !VMS
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif // VMS/!VMS
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef sun
|
#ifdef sun
|
||||||
#include <sys/filio.h>
|
#include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // __UNIX__
|
#endif // __UNIX__
|
||||||
@@ -98,30 +99,31 @@ void wxMacProcessEvents() ;
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef __VISUALC__
|
#ifdef __VISUALC__
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WXMOTIF__) || defined(__WXXT__)
|
#if defined(__WXMOTIF__) || defined(__WXXT__)
|
||||||
#include <X11/Intrinsic.h>
|
#include <X11/Intrinsic.h>
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// Needs internal variables
|
// Needs internal variables
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
#ifdef __WXXT__
|
#ifdef __WXXT__
|
||||||
#define Uses_XtIntrinsic
|
#define Uses_XtIntrinsic
|
||||||
#endif
|
#endif
|
||||||
|
#endif // Motif or Xt
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__WXGTK__)
|
#if defined(__WXGTK__)
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// wxSocket headers
|
// wxSocket headers
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#include "wx/module.h"
|
#include "wx/module.h"
|
||||||
|
|
||||||
#define WXSOCK_INTERNAL
|
#define WXSOCK_INTERNAL
|
||||||
|
|
||||||
#include "wx/sckaddr.h"
|
#include "wx/sckaddr.h"
|
||||||
#include "wx/socket.h"
|
#include "wx/socket.h"
|
||||||
|
|
||||||
@@ -174,11 +176,11 @@ int PASCAL FAR __WSAFDIsSet(SOCKET fd, fd_set FAR *set)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
#define PROCESS_EVENTS() wxYield()
|
#define PROCESS_EVENTS() wxYield()
|
||||||
#elif defined(__WXXT__) || defined(__WXMOTIF__)
|
#elif defined(__WXXT__) || defined(__WXMOTIF__)
|
||||||
#define PROCESS_EVENTS() XtAppProcessEvent(wxAPP_CONTEXT, XtIMAll)
|
#define PROCESS_EVENTS() XtAppProcessEvent(wxAPP_CONTEXT, XtIMAll)
|
||||||
#elif defined(__WXGTK__)
|
#elif defined(__WXGTK__)
|
||||||
#define PROCESS_EVENTS() gtk_main_iteration()
|
#define PROCESS_EVENTS() gtk_main_iteration()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -205,12 +207,12 @@ public:
|
|||||||
// ClassInfos
|
// ClassInfos
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_CLASS(wxSocketBase, wxObject)
|
IMPLEMENT_CLASS(wxSocketBase, wxObject)
|
||||||
IMPLEMENT_CLASS(wxSocketServer, wxSocketBase)
|
IMPLEMENT_CLASS(wxSocketServer, wxSocketBase)
|
||||||
IMPLEMENT_CLASS(wxSocketClient, wxSocketBase)
|
IMPLEMENT_CLASS(wxSocketClient, wxSocketBase)
|
||||||
IMPLEMENT_CLASS(wxSocketHandler, wxObject)
|
IMPLEMENT_CLASS(wxSocketHandler, wxObject)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSocketEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxSocketEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSocketModule, wxModule)
|
IMPLEMENT_DYNAMIC_CLASS(wxSocketModule, wxModule)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class wxSockWakeUp : public wxTimer
|
class wxSockWakeUp : public wxTimer
|
||||||
@@ -532,24 +534,14 @@ void wxSocketBase::Discard()
|
|||||||
#undef MAX_BUFSIZE
|
#undef MAX_BUFSIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
// If what? Who seems to need unsigned int?
|
// this is normally defined by configure, but if it wasn't try to do it here
|
||||||
// BTW uint isn't even defined on wxMSW for VC++ for some reason. Even if it
|
#ifndef SOCKLEN_T
|
||||||
// were, getpeername/getsockname don't take unsigned int*, they take int*.
|
#if wxHAVE_GLIBC2
|
||||||
//
|
typedef socklen_t SOCKLEN_T;
|
||||||
// Under glibc 2.0.7, socketbits.h declares socklen_t to be unsigned int
|
#else
|
||||||
// and it uses *socklen_t as the 3rd parameter. Robert.
|
typedef int SOCKET_INT;
|
||||||
|
#endif
|
||||||
// JACS - How can we detect this?
|
#endif // SOCKLEN_T
|
||||||
// Meanwhile, if your compiler complains about socklen_t,
|
|
||||||
// switch lines below.
|
|
||||||
|
|
||||||
#if wxHAVE_GLIBC2
|
|
||||||
# typedef socklen_t wxSOCKET_INT;
|
|
||||||
#elif defined(__AIX__)
|
|
||||||
# typedef size_t wxSOCKET_INT;
|
|
||||||
#else
|
|
||||||
# typedef int wxSOCKET_INT;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
// wxSocketBase socket info functions
|
// wxSocketBase socket info functions
|
||||||
@@ -558,7 +550,7 @@ void wxSocketBase::Discard()
|
|||||||
bool wxSocketBase::GetPeer(wxSockAddress& addr_man) const
|
bool wxSocketBase::GetPeer(wxSockAddress& addr_man) const
|
||||||
{
|
{
|
||||||
struct sockaddr my_addr;
|
struct sockaddr my_addr;
|
||||||
wxSOCKET_INT len_addr = sizeof(my_addr);
|
SOCKLEN_T len_addr = (SOCKLEN_T)sizeof(my_addr);
|
||||||
|
|
||||||
if (m_fd < 0)
|
if (m_fd < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -573,13 +565,12 @@ bool wxSocketBase::GetPeer(wxSockAddress& addr_man) const
|
|||||||
bool wxSocketBase::GetLocal(wxSockAddress& addr_man) const
|
bool wxSocketBase::GetLocal(wxSockAddress& addr_man) const
|
||||||
{
|
{
|
||||||
struct sockaddr my_addr;
|
struct sockaddr my_addr;
|
||||||
wxSOCKET_INT len_addr = sizeof(my_addr);
|
SOCKLEN_T len_addr = (SOCKLEN_T)sizeof(my_addr);
|
||||||
|
|
||||||
if (m_fd < 0)
|
if (m_fd < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (getsockname(m_fd, (struct sockaddr *)&my_addr, &len_addr) < 0)
|
if (getsockname(m_fd, (struct sockaddr *)&my_addr, &len_addr) < 0)
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
addr_man.Disassemble(&my_addr, len_addr);
|
addr_man.Disassemble(&my_addr, len_addr);
|
||||||
|
@@ -104,25 +104,14 @@ extern const char WXDLLEXPORT *g_szNul = &g_strEmpty.dummy;
|
|||||||
// always available), but it's unsafe because it doesn't check for buffer
|
// always available), but it's unsafe because it doesn't check for buffer
|
||||||
// size - so give a warning
|
// size - so give a warning
|
||||||
#define wxVsprintf(buffer,len,format,argptr) vsprintf(buffer,format, argptr)
|
#define wxVsprintf(buffer,len,format,argptr) vsprintf(buffer,format, argptr)
|
||||||
#if defined(__VISUALC__)
|
|
||||||
#pragma message("Using sprintf() because no snprintf()-like function defined")
|
|
||||||
#elif defined(__GNUG__)
|
|
||||||
#warning "Using sprintf() because no snprintf()-like function defined"
|
|
||||||
#elif defined(__MWERKS__)
|
|
||||||
#warning "Using sprintf() because no snprintf()-like function defined"
|
|
||||||
#elif defined(__WATCOMC__)
|
|
||||||
// No warning
|
|
||||||
#elif defined(__BORLANDC__)
|
|
||||||
// No warning
|
|
||||||
#elif defined(__SUNCC__)
|
|
||||||
// nothing -- I don't know about "#warning" for Sun's CC
|
|
||||||
#elif defined(__DECCXX)
|
|
||||||
// nothing
|
|
||||||
#else
|
|
||||||
// change this to some analogue of '#warning' for your compiler
|
|
||||||
#error "Using sprintf() because no snprintf()-like function defined"
|
|
||||||
#endif //compiler
|
|
||||||
|
|
||||||
|
#if defined(__VISUALC__)
|
||||||
|
#pragma message("Using sprintf() because no snprintf()-like function defined")
|
||||||
|
#elif defined(__GNUG__) && !defined(__UNIX__)
|
||||||
|
#warning "Using sprintf() because no snprintf()-like function defined"
|
||||||
|
#elif defined(__MWERKS__)
|
||||||
|
#warning "Using sprintf() because no snprintf()-like function defined"
|
||||||
|
#endif //compiler
|
||||||
#endif // no vsnprintf
|
#endif // no vsnprintf
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -457,6 +457,7 @@ bool wxVariantDataReal::Read(wxString& str)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_BOOL
|
||||||
/*
|
/*
|
||||||
* wxVariantDataBool
|
* wxVariantDataBool
|
||||||
*/
|
*/
|
||||||
@@ -547,6 +548,7 @@ bool wxVariantDataBool::Read(wxString& str)
|
|||||||
m_value = (atol((const char*) str) != 0);
|
m_value = (atol((const char*) str) != 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#endif // HAVE_BOOL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wxVariantDataChar
|
* wxVariantDataChar
|
||||||
@@ -991,11 +993,13 @@ wxVariant::wxVariant(long val, const wxString& name)
|
|||||||
m_name = name;
|
m_name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_BOOL
|
||||||
wxVariant::wxVariant(bool val, const wxString& name)
|
wxVariant::wxVariant(bool val, const wxString& name)
|
||||||
{
|
{
|
||||||
m_data = new wxVariantDataBool(val);
|
m_data = new wxVariantDataBool(val);
|
||||||
m_name = name;
|
m_name = name;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
wxVariant::wxVariant(char val, const wxString& name)
|
wxVariant::wxVariant(char val, const wxString& name)
|
||||||
{
|
{
|
||||||
@@ -1205,6 +1209,7 @@ void wxVariant::operator= (char value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_BOOL
|
||||||
bool wxVariant::operator== (bool value) const
|
bool wxVariant::operator== (bool value) const
|
||||||
{
|
{
|
||||||
bool thisValue;
|
bool thisValue;
|
||||||
@@ -1232,6 +1237,7 @@ void wxVariant::operator= (bool value)
|
|||||||
m_data = new wxVariantDataBool(value);
|
m_data = new wxVariantDataBool(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // HAVE_BOOL
|
||||||
|
|
||||||
bool wxVariant::operator== (const wxString& value) const
|
bool wxVariant::operator== (const wxString& value) const
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user