[Opalvoip-svn] SF.net SVN: opalvoip:[27066] ptlib/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2012-02-28 08:24:03
|
Revision: 27066 http://opalvoip.svn.sourceforge.net/opalvoip/?rev=27066&view=rev Author: rjongbloed Date: 2012-02-28 08:23:49 +0000 (Tue, 28 Feb 2012) Log Message: ----------- Clean up of the platform dependent code, in multiple locations before (contain.h and pmachdep.h) now normalised to a platform.h. Modified Paths: -------------- ptlib/trunk/configure ptlib/trunk/configure.ac ptlib/trunk/include/ptbuildopts.h.in ptlib/trunk/include/ptlib/contain.h ptlib/trunk/include/ptlib/object.h ptlib/trunk/include/ptlib/pstring.h ptlib/trunk/include/ptlib.h Added Paths: ----------- ptlib/trunk/include/ptlib/Nucleus++/ptlib/platform.h ptlib/trunk/include/ptlib/msos/ptlib/platform.h ptlib/trunk/include/ptlib/unix/ptlib/platform.h Removed Paths: ------------- ptlib/trunk/include/ptlib/Nucleus++/ptlib/contain.h ptlib/trunk/include/ptlib/Nucleus++/ptlib/pmachdep.h ptlib/trunk/include/ptlib/msos/ptlib/contain.h ptlib/trunk/include/ptlib/unix/ptlib/contain.h ptlib/trunk/include/ptlib/unix/ptlib/pmachdep.h Modified: ptlib/trunk/configure =================================================================== --- ptlib/trunk/configure 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/configure 2012-02-28 08:23:49 UTC (rev 27066) @@ -6796,6 +6796,7 @@ + for ac_header in wchar.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" @@ -6803,8 +6804,13 @@ cat >>confdefs.h <<_ACEOF #define HAVE_WCHAR_H 1 _ACEOF - $as_echo "#define P_HAS_WCHAR 1" >>confdefs.h + $as_echo "#define P_HAS_WCHAR 1" >>confdefs.h + + $as_echo "#define P_HAS_WOSTREAM 1" >>confdefs.h + + + fi done @@ -8505,7 +8511,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> -#include <sys/socket.h> + #include <sys/socket.h> #include <netdb.h> int main () Modified: ptlib/trunk/configure.ac =================================================================== --- ptlib/trunk/configure.ac 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/configure.ac 2012-02-28 08:23:49 UTC (rev 27066) @@ -993,9 +993,18 @@ dnl MSWIN_DISPLAY wchar,wchar Support dnl MSWIN_DEFINE wchar,P_HAS_WCHAR -AC_CHECK_HEADERS(wchar.h, [AC_DEFINE(P_HAS_WCHAR, 1)]) +dnl MSWIN_DISPLAY wstream,wchar stream Support +dnl MSWIN_DEFINE wstream,P_HAS_WOSTREAM +AC_CHECK_HEADERS( + wchar.h, + [ + AC_DEFINE(P_HAS_WCHAR, 1) + AC_DEFINE(P_HAS_WOSTREAM, 1) + ] +) + dnl ######################################################################## dnl check for regex library Modified: ptlib/trunk/include/ptbuildopts.h.in =================================================================== --- ptlib/trunk/include/ptbuildopts.h.in 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/include/ptbuildopts.h.in 2012-02-28 08:23:49 UTC (rev 27066) @@ -61,20 +61,33 @@ ///////////////////////////////////////////////// // -// sizeof(int) +// Language stuff // -#undef SIZEOF_INT -#undef PNO_LONG_DOUBLE +#undef P_USE_STANDARD_CXX_BOOL +#if !defined(P_USE_STANDARD_CXX_BOOL) + #define P_USE_INTEGER_BOOL 1 +#endif +#undef P_EXCEPTIONS +#define P_USE_ASSERTS 1 + + ///////////////////////////////////////////////// // -// Processor endianess +// Integer/char types // -#if !defined(P_MACOSX) - #undef PBYTE_ORDER -#else +#undef SIZEOF_INT +#undef PNO_LONG_DOUBLE + +#undef P_HAS_WCHAR +#if P_HAS_WCHAR + #undef P_HAS_WOSTREAM +#endif + +#undef PBYTE_ORDER +#ifndef PBYTE_ORDER #if defined(__BIG_ENDIAN__) #define PBYTE_ORDER PBIG_ENDIAN #else @@ -82,6 +95,7 @@ #endif #endif + ///////////////////////////////////////////////// // // Runtime dynamic link libraries @@ -91,26 +105,54 @@ #undef P_PLUGINS #undef P_DEFAULT_PLUGIN_DIR + ///////////////////////////////////////////////// // -// PThreads and related vars +// Threads and Unix variants for network stuff // #undef P_PTHREADS #undef P_HAS_SEMAPHORES +#undef P_HAS_ATOMIC_INT +#undef P_NEEDS_GNU_CXX_NAMESPACE +#undef P_HAS_RECURSIVE_MUTEX +#undef P_HAS_RECVMSG +#undef P_HAS_RECVMSG_MSG_ERRQUEUE +#undef P_HAS_RECVMSG_IP_RECVERR +#undef P_HAS_NETLINK +#undef P_SETPGRP_NOPARM #undef P_HAS_NAMED_SEMAPHORES #undef P_PTHREADS_XPG6 #undef P_HAS_SEMAPHORES_XPG6 -#undef P_EXCEPTIONS #undef P_HAS_AIO -#undef P_HAS_WCHAR +#undef P_HAS_POSIX_READDIR_R +#undef P_HAS_UPAD128_T +#undef P_HAS_INET_NTOP +#undef P_HAS_IPV6_ADD_MEMBERSHIP +#ifndef _WIN32_WCE + #undef P_HAS_IPV6 + #undef P_QOS +#endif // _WIN32_WCE + ///////////////////////////////////////////////// // -// various non-core functions +// various platform specific features // +#undef P_LPIA +#undef USE_SYSTEM_SWAB +#undef P_SHM_VIDEO + + +///////////////////////////////////////////////// +// +// various non-platform specific features +// + +#undef PMEMORY_CHECK + #undef P_AUDIO #undef P_VIDEO @@ -126,6 +168,7 @@ #undef P_SNMP #undef P_TELNET #undef P_CLI +#undef P_ODBC #undef P_REMCONN #undef P_SERIAL #undef P_POP3SMTP @@ -153,51 +196,12 @@ #endif #endif -#undef P_SOCKAGG #undef P_VIDFILE #undef P_FFVDEV -#undef P_ODBC -#undef P_SHM_VIDEO -#undef P_LPIA -#undef P_HAS_POSIX_READDIR_R -#undef P_HAS_ATOMIC_INT -#undef P_HAS_RECURSIVE_MUTEX -#undef P_NEEDS_GNU_CXX_NAMESPACE -#undef PMEMORY_CHECK -#undef P_HAS_RECVMSG -#undef P_HAS_RECVMSG_MSG_ERRQUEUE -#undef P_HAS_RECVMSG_IP_RECVERR -#undef P_HAS_NETLINK -#undef P_HAS_UPAD128_T -#undef P_HAS_INET_NTOP -#undef P_SETPGRP_NOPARM -#undef P_HAS_IPV6_ADD_MEMBERSHIP - ///////////////////////////////////////////////// // -// IP v6 Support -// - -#ifndef _WIN32_WCE - #undef P_HAS_IPV6 -#endif // _WIN32_WCE - - -///////////////////////////////////////////////// -// -// QoS Support -// -// - -#ifndef _WIN32_WCE - #undef P_QOS -#endif // _WIN32_WCE - - -///////////////////////////////////////////////// -// // OpenSSL library for secure sockets layer // @@ -757,21 +761,9 @@ #endif -///////////////////////////////////////////////// -// -// various functions -// -#undef USE_SYSTEM_SWAB -#undef P_USE_STANDARD_CXX_BOOL -#if !defined(P_USE_STANDARD_CXX_BOOL) -# define P_USE_INTEGER_BOOL -#endif - - #endif // PTLIB_BUILDOPTS_H -#define P_USE_ASSERTS 1 // End Of File /////////////////////////////////////////////////////////////// Deleted: ptlib/trunk/include/ptlib/Nucleus++/ptlib/contain.h =================================================================== --- ptlib/trunk/include/ptlib/Nucleus++/ptlib/contain.h 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/include/ptlib/Nucleus++/ptlib/contain.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -1,171 +0,0 @@ -/* - * contain.h - * - * Low level object and container definitions. - * - * Portable Windows Library - * - * Copyright (c) 1993-1998 Equivalence Pty. Ltd. - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and limitations - * under the License. - * - * The Original Code is Portable Windows Library. - * - * The Initial Developer of the Original Code is Equivalence Pty. Ltd. - * - * Portions are Copyright (C) 1993 Free Software Foundation, Inc. - * All Rights Reserved. - * - * Contributor(s): ______________________________________. - * - * $Revision$ - * $Author$ - * $Date$ - */ - -#ifndef _PCONTAIN -#define _PCONTAIN - -// Wos ere. Moved so that types are defined properly in the right order. -//#include "pmachdep.h" - -#ifdef __NUCLEUS_MNT__ -#pragma message ("<unistd.h> not included") -#ifndef _WINSOCKAPI_ -#define _WINSOCKAPI_ /* _WINSOCKAPI_ must be defined to keep the */ -#endif /* winsock.h file from being included. If it is */ - /* included some of the typedefs will conflict */ - /* with those in Nucleus NET. */ - -#pragma message ("Include VNET stuff") -extern "C" - { -#include "net\inc\externs.h" // Nucleus (V)NET unofficial -#include "control.h" // Nucleus (V)NET official -#include "net\inc\Sockext.h" - } - -// This really is for VNET only, because they've used INT16 in NET and not -// even bothered to define it in NET. -//typedef int16 INT16; - -#else -#include <unistd.h> -#endif -#include <ctype.h> - - -/////////////////////////////////////////// -// -// define TRUE and FALSE for environments that don't have them -// - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -/////////////////////////////////////////// -// -// define a macro for declaring classes so we can bolt -// extra things to class declarations -// - -#define PEXPORT -#define PSTATIC - - -/////////////////////////////////////////// -// -// define some basic types and their limits -// - -typedef unsigned char BYTE; // 1 byte - -typedef signed short PInt16; // 16 bit -typedef unsigned short WORD; - -typedef signed int PInt32; // 32 bit -#ifndef __NUCLEUS_MNT__ -typedef unsigned int DWORD; -#else // __NUCLEUS_MNT__ -typedef unsigned long DWORD; -typedef long int int32; -#if 0 // Shouldn't be necessary now we're VNET 4.2 -typedef int16 INT16; -typedef uint16 UINT16; -#endif -#endif - -#define P_HAS_INT64 - -#ifdef _MSC_VER // MS compiler should set MSC_VER -typedef signed __int64 PInt64; -typedef unsigned __int64 PUInt64; - -#include <iostream> -//class ostream; -//class istream; - -ostream & operator<<(ostream & s, PInt64 v); -ostream & operator<<(ostream & s, PUInt64 v); - -istream & operator>>(istream & s, PInt64 & v); -istream & operator>>(istream & s, PUInt64 & v); -#endif // Diab compiler uses long long for 64-bit -#ifdef __GNUC__ -typedef signed long long int PInt64; -typedef unsigned long long int PUInt64; - -#include <istream> -#include <ostream> - -ostream & operator<<(ostream & s, PInt64 v); -ostream & operator<<(ostream & s, PUInt64 v); - -istream & operator>>(istream & s, PInt64 & v); -istream & operator>>(istream & s, PUInt64 & v); -#endif -#ifdef __DIAB -typedef signed long long int PInt64; -typedef unsigned long long int PUInt64; // 64 bit -#endif - -// Integer type that is same size as a pointer type. -#ifdef P_64BIT -typedef long INT; -#else -typedef int INT; -#endif - -// MSVC problem requires a PINDEX to be #defined (specifically) to an int -// (specifically) -#ifdef __NUCLEUS_MNT__ -#define PINDEX int -#else -typedef size_t PINDEX; -#endif - -#define P_MAX_INDEX 0x7fffffff -#define PABSINDEX(idx) (idx) // careful - size_t may be signed! -#define PASSERTINDEX(idx) - -#include "pmachdep.h" - - -/////////////////////////////////////////// -// -// include common declarations -// - -#include "../../contain.h" - -#endif Copied: ptlib/trunk/include/ptlib/Nucleus++/ptlib/platform.h (from rev 27065, ptlib/trunk/include/ptlib/Nucleus++/ptlib/pmachdep.h) =================================================================== --- ptlib/trunk/include/ptlib/Nucleus++/ptlib/platform.h (rev 0) +++ ptlib/trunk/include/ptlib/Nucleus++/ptlib/platform.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -0,0 +1,245 @@ +/* + * platform.h + * + * Unix machine dependencies + * + * Portable Windows Library + * + * Copyright (c) 1993-1998 Equivalence Pty. Ltd. + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Portable Windows Library. + * + * The Initial Developer of the Original Code is Equivalence Pty. Ltd. + * + * Portions are Copyright (C) 1993 Free Software Foundation, Inc. + * All Rights Reserved. + * + * Contributor(s): ______________________________________. + * + * $Revision$ + * $Author$ + * $Date$ + */ + +#ifndef PTLIB_PALTFORM_H +#define PTLIB_PALTFORM_H + +/////////////////////////////////////////////////////////////////////////////// + +#ifdef __NUCLEUS_MNT__ +#pragma message ("<netdb.h> not included") +#define P_PLATFORM_HAS_THREADS +// The windows version of errno.h, which this will find, should do for us - +// it contains lots of things from Unix!!! +#include <errno.h> +#else +#ifdef __NUCLEUS_PLUS__ +#define P_PLATFORM_HAS_THREADS +#endif +#ifndef __NUCLEUS_PLUS__ +#include <netdb.h> +#endif +#endif + + +#if defined(P_PTHREADS) +#define P_PLATFORM_HAS_THREADS +#ifndef __NUCLEUS_PLUS__ +#include <pthread.h> +#endif +#endif + +// If we're running effectively 'doze, then it's little endian. If PoserPC, +// big endian. +#ifdef __NUCLEUS_MNT__ +#define PBYTE_ORDER PLITTLE_ENDIAN +#else +//#define PBYTE_ORDER PBIG_ENDIAN +#endif + +#if 0 +#ifdef __NUCLEUS_PLUS__ +// Other things +#define INADDR_NONE -1 +#endif +#endif + +#ifdef __NUCLEUS_MNT__ +#define BREAKPOINT _asm int 3; +#endif +#ifdef __ppc +#define BREAKPOINT asm("sc"); +#endif + + +/* + * contain.h + * + * Low level object and container definitions. + * + * Portable Windows Library + * + * Copyright (c) 1993-1998 Equivalence Pty. Ltd. + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Portable Windows Library. + * + * The Initial Developer of the Original Code is Equivalence Pty. Ltd. + * + * Portions are Copyright (C) 1993 Free Software Foundation, Inc. + * All Rights Reserved. + * + * Contributor(s): ______________________________________. + * + * $Revision$ + * $Author$ + * $Date$ + */ + +// Wos ere. Moved so that types are defined properly in the right order. +//#include "pmachdep.h" + +#ifdef __NUCLEUS_MNT__ +#pragma message ("<unistd.h> not included") +#ifndef _WINSOCKAPI_ +#define _WINSOCKAPI_ /* _WINSOCKAPI_ must be defined to keep the */ +#endif /* winsock.h file from being included. If it is */ + /* included some of the typedefs will conflict */ + /* with those in Nucleus NET. */ + +#pragma message ("Include VNET stuff") +extern "C" + { +#include "net\inc\externs.h" // Nucleus (V)NET unofficial +#include "control.h" // Nucleus (V)NET official +#include "net\inc\Sockext.h" + } + +// This really is for VNET only, because they've used INT16 in NET and not +// even bothered to define it in NET. +//typedef int16 INT16; + +#else +#include <unistd.h> +#endif +#include <ctype.h> + + +/////////////////////////////////////////// +// +// define TRUE and FALSE for environments that don't have them +// + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +/////////////////////////////////////////// +// +// define a macro for declaring classes so we can bolt +// extra things to class declarations +// + +#define PEXPORT +#define PSTATIC + + +/////////////////////////////////////////// +// +// define some basic types and their limits +// + +typedef unsigned char BYTE; // 1 byte + +typedef signed short PInt16; // 16 bit +typedef unsigned short WORD; + +typedef signed int PInt32; // 32 bit +#ifndef __NUCLEUS_MNT__ +typedef unsigned int DWORD; +#else // __NUCLEUS_MNT__ +typedef unsigned long DWORD; +typedef long int int32; +#if 0 // Shouldn't be necessary now we're VNET 4.2 +typedef int16 INT16; +typedef uint16 UINT16; +#endif +#endif + +#define P_HAS_INT64 + +#ifdef _MSC_VER // MS compiler should set MSC_VER +typedef signed __int64 PInt64; +typedef unsigned __int64 PUInt64; + +#include <iostream> +//class ostream; +//class istream; + +ostream & operator<<(ostream & s, PInt64 v); +ostream & operator<<(ostream & s, PUInt64 v); + +istream & operator>>(istream & s, PInt64 & v); +istream & operator>>(istream & s, PUInt64 & v); +#endif // Diab compiler uses long long for 64-bit +#ifdef __GNUC__ +typedef signed long long int PInt64; +typedef unsigned long long int PUInt64; + +#include <istream> +#include <ostream> + +ostream & operator<<(ostream & s, PInt64 v); +ostream & operator<<(ostream & s, PUInt64 v); + +istream & operator>>(istream & s, PInt64 & v); +istream & operator>>(istream & s, PUInt64 & v); +#endif +#ifdef __DIAB +typedef signed long long int PInt64; +typedef unsigned long long int PUInt64; // 64 bit +#endif + +// Integer type that is same size as a pointer type. +#ifdef P_64BIT +typedef long INT; +#else +typedef int INT; +#endif + +// MSVC problem requires a PINDEX to be #defined (specifically) to an int +// (specifically) +#ifdef __NUCLEUS_MNT__ +#define PINDEX int +#else +typedef size_t PINDEX; +#endif + +#define P_MAX_INDEX 0x7fffffff +#define PABSINDEX(idx) (idx) // careful - size_t may be signed! +#define PASSERTINDEX(idx) + + +#endif // PTLIB_PALTFORM_H + +// End of file Deleted: ptlib/trunk/include/ptlib/Nucleus++/ptlib/pmachdep.h =================================================================== --- ptlib/trunk/include/ptlib/Nucleus++/ptlib/pmachdep.h 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/include/ptlib/Nucleus++/ptlib/pmachdep.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -1,275 +0,0 @@ -/* - * machdep.h - * - * Unix machine dependencies - * - * Portable Windows Library - * - * Copyright (c) 1993-1998 Equivalence Pty. Ltd. - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and limitations - * under the License. - * - * The Original Code is Portable Windows Library. - * - * The Initial Developer of the Original Code is Equivalence Pty. Ltd. - * - * Portions are Copyright (C) 1993 Free Software Foundation, Inc. - * All Rights Reserved. - * - * Contributor(s): ______________________________________. - * - * $Revision$ - * $Author$ - * $Date$ - */ - -#ifndef _PMACHDEP_H -#define _PMACHDEP_H - -/////////////////////////////////////////////////////////////////////////////// -#if defined(P_LINUX) - -#include <paths.h> -#include <errno.h> -#include <signal.h> -#include <sys/ioctl.h> -#include <sys/fcntl.h> -#include <sys/termios.h> -#include <unistd.h> -#include <net/if.h> -#include <netinet/in.h> -#include <dlfcn.h> - - -#define HAS_IFREQ -#define PSETPGRP() setpgrp() - -#if __GNU_LIBRARY__ < 6 -#define P_LINUX_LIB_OLD -typedef int socklen_t; -#endif - -#ifdef PPC -typedef size_t socklen_t; -#endif - -/////////////////////////////////////////////////////////////////////////////// -#elif defined(P_FREEBSD) - -#if defined(P_PTHREADS) -#define _THREAD_SAFE -#define P_THREAD_SAFE_CLIB - -#include <pthread.h> -extern "C" int sigwait(sigset_t *set); -#endif - -#include <paths.h> -#include <errno.h> -#include <dlfcn.h> -#include <termios.h> -#include <sys/fcntl.h> -#include <sys/filio.h> -#include <sys/socket.h> -#include <sys/sockio.h> -#include <sys/signal.h> -#include <net/if.h> - -#define HAS_IFREQ - -#define PSETPGRP() setpgrp(0, 0) - -typedef int socklen_t; - -/////////////////////////////////////////////////////////////////////////////// -#elif defined(P_SOLARIS) - -#include <errno.h> -#include <sys/sockio.h> -#include <sys/ioctl.h> -#include <sys/fcntl.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/termios.h> -#include <sys/socket.h> -#include <sys/ioctl.h> -#include <sys/filio.h> -#include <sys/wait.h> -#include <sys/uio.h> -#include <fcntl.h> -#include <unistd.h> -#include <net/if.h> -#include <netinet/in.h> -#include <dlfcn.h> -#include <net/if.h> -#include <sys/sockio.h> - -#define PSETPGRP() setpgrp() - -#define INADDR_NONE -1 -#if P_SOLARIS < 7 -typedef int socklen_t; -#endif - -#define HAS_IFREQ - -extern "C" { - -int ftime (struct timeb *); -pid_t wait3(int *status, int options, struct rusage *rusage); -int gethostname(char *, int); - -}; - -/////////////////////////////////////////////////////////////////////////////// -#elif defined (P_SUN4) - -#include <errno.h> -#include <sys/socket.h> -#include <sys/time.h> -#include <sys/types.h> -#include <signal.h> -#include <net/if.h> -#include <sys/sockio.h> - -#define HAS_IFREQ -#define PSETPGRP() setpgrp(0, 0) -#define raise(s) kill(getpid(),s) - -#error P_SUN4 - -extern "C" { - -char *mktemp(char *); -int accept(int, struct sockaddr *, int *); -int connect(int, struct sockaddr *, int); -int ioctl(int, int, void *); -int recv(int, void *, int, int); -int recvfrom(int, void *, int, int, struct sockaddr *, int *); -int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); -int sendto(int, const void *, int, int, const struct sockaddr *, int); -int send(int, const void *, int, int); -int shutdown(int, int); -int socket(int, int, int); -int vfork(); -void bzero(void *, int); -void closelog(); -void gettimeofday(struct timeval * tv, struct timezone * tz); -void openlog(const char *, int, int); -void syslog(int, char *, ...); -int setpgrp(int, int); -pid_t wait3(int *status, int options, struct rusage *rusage); -int bind(int, struct sockaddr *, int); -int listen(int, int); -int getsockopt(int, int, int, char *, int *); -int setsockopt(int, int, int, char *, int); -int getpeername(int, struct sockaddr *, int *); -int gethostname(char *, int); -int getsockname(int, struct sockaddr *, int *); -char * inet_ntoa(struct in_addr); - -int ftime (struct timeb *); - -struct hostent * gethostbyname(const char *); -struct hostent * gethostbyaddr(const char *, int, int); -struct servent * getservbyname(const char *, const char *); - -#include <sys/termios.h> -#undef NL0 -#undef NL1 -#undef CR0 -#undef CR1 -#undef CR2 -#undef CR3 -#undef TAB0 -#undef TAB1 -#undef TAB2 -#undef XTABS -#undef BS0 -#undef BS1 -#undef FF0 -#undef FF1 -#undef ECHO -#undef NOFLSH -#undef TOSTOP -#undef FLUSHO -#undef PENDIN -}; - - -#elif __BEOS__ - -#include <errno.h> -#include <termios.h> -#include <sys/socket.h> -#include <OS.h> - -#define SOCK_RAW 3 // raw-protocol interface, not suported in R4 -#define PF_INET AF_INET -typedef int socklen_t; -#define INADDR_NONE INADDR_BROADCAST -#define wait3(s, o, r) waitpid(-1, s, o) -#define PSETPGRP() setpgid(0,0) - -#else - -// Other operating systems here - -#endif - -#ifdef __NUCLEUS_MNT__ -#pragma message ("<netdb.h> not included") -#define P_PLATFORM_HAS_THREADS -// The windows version of errno.h, which this will find, should do for us - -// it contains lots of things from Unix!!! -#include <errno.h> -#else -#ifdef __NUCLEUS_PLUS__ -#define P_PLATFORM_HAS_THREADS -#endif -#ifndef __NUCLEUS_PLUS__ -#include <netdb.h> -#endif -#endif - - -#if defined(P_PTHREADS) -#define P_PLATFORM_HAS_THREADS -#ifndef __NUCLEUS_PLUS__ -#include <pthread.h> -#endif -#endif - -// If we're running effectively 'doze, then it's little endian. If PoserPC, -// big endian. -#ifdef __NUCLEUS_MNT__ -#define PBYTE_ORDER PLITTLE_ENDIAN -#else -//#define PBYTE_ORDER PBIG_ENDIAN -#endif - -#if 0 -#ifdef __NUCLEUS_PLUS__ -// Other things -#define INADDR_NONE -1 -#endif -#endif - -#ifdef __NUCLEUS_MNT__ -#define BREAKPOINT _asm int 3; -#endif -#ifdef __ppc -#define BREAKPOINT asm("sc"); -#endif - -#endif // _PMACHDEP_H - -// End of file Modified: ptlib/trunk/include/ptlib/contain.h =================================================================== --- ptlib/trunk/include/ptlib/contain.h 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/include/ptlib/contain.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -39,11 +39,10 @@ #endif -#include <ptlib/critsec.h> #include <ptlib/object.h> +#include <ptlib/critsec.h> - /////////////////////////////////////////////////////////////////////////////// // Abstract container class Deleted: ptlib/trunk/include/ptlib/msos/ptlib/contain.h =================================================================== --- ptlib/trunk/include/ptlib/msos/ptlib/contain.h 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/include/ptlib/msos/ptlib/contain.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -1,456 +0,0 @@ -/* - * contain.h - * - * General container classes. - * - * Portable Windows Library - * - * Copyright (c) 1993-1998 Equivalence Pty. Ltd. - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and limitations - * under the License. - * - * The Original Code is Portable Windows Library. - * - * The Initial Developer of the Original Code is Equivalence Pty. Ltd. - * - * Portions are Copyright (C) 1993 Free Software Foundation, Inc. - * All Rights Reserved. - * - * Contributor(s): ______________________________________. - * - * $Revision$ - * $Author$ - * $Date$ - */ - -#ifndef PTLIB_CONTAIN_H -#ifndef _WIN32_WCE -#error "Please remove pwlib\include\ptlib\msos from the tool include path" \ -"and from the pre-processor options for this project" -#endif // !_WIN32_WCE -#endif - -#ifndef PTLIB_MSOS_CONTAIN_H -#define PTLIB_MSOS_CONTAIN_H - - -#ifdef _MSC_VER - - #pragma warning(disable:4201) // nonstandard extension: nameless struct/union - #pragma warning(disable:4201) // nonstandard extension: nameless struct/union - #pragma warning(disable:4251) // disable warning exported structs - #pragma warning(disable:4511) // default copy ctor not generated warning - #pragma warning(disable:4512) // default assignment op not generated warning - #pragma warning(disable:4514) // unreferenced inline removed - #pragma warning(disable:4699) // precompiled headers - #pragma warning(disable:4702) // disable warning about unreachable code - #pragma warning(disable:4705) // disable warning about statement has no effect - #pragma warning(disable:4710) // inline not expanded warning - #pragma warning(disable:4711) // auto inlining warning - #pragma warning(disable:4786) // identifier was truncated to '255' characters in the debug information - #pragma warning(disable:4097) // typedef synonym for class - #pragma warning(disable:4800) // forcing value to bool 'true' or 'false' (performance warning) - - #if !defined(_CRT_SECURE_NO_DEPRECATE) && (_MSC_VER>=1400) - #define _CRT_SECURE_NO_DEPRECATE 1 - #endif - - #if !defined(_CRT_NONSTDC_NO_WARNINGS) && (_MSC_VER>=1400) - #define _CRT_NONSTDC_NO_WARNINGS 1 - #endif - -#endif // _MSC_VER - - -/////////////////////////////////////////////////////////////////////////////// -// Machine & Compiler dependent declarations - -#ifndef WIN32 - #define WIN32 1 -#endif - -#ifndef _WIN32 - #define _WIN32 1 -#endif - -#if defined(_WIN64) && !defined(P_64BIT) -#define P_64BIT 1 -#endif - -#if defined(_WINDOWS) || defined(_WIN32) - - // At least Windows 2000, configure.ac will generally uprate this - #ifndef WINVER - #define WINVER 0x0500 - #endif - - #if !defined(_WIN32_WINNT) && !defined(_WIN32_WCE) - #define _WIN32_WINNT WINVER - #endif - - #if !defined(_WIN32_WCE) && defined(_WIN32_WINNT) && (_WIN32_WINNT == 0x0500) && P_HAS_IPV6 && !defined(NTDDI_VERSION) - #define NTDDI_VERSION NTDDI_WIN2KSP1 - #endif - - #ifndef STRICT - #define STRICT - #endif - - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN - #endif - - #include <windows.h> - - #undef DELETE // Remove define from NT headers. - - -#else - - typedef unsigned char BYTE; // 8 bit unsigned integer quantity - typedef unsigned short WORD; // 16 bit unsigned integer quantity - typedef unsigned long DWORD; // 32 bit unsigned integer quantity - typedef int BOOL; // type returned by expresion (i != j) - - #define TRUE 1 - #define FALSE 0 - - #define NEAR __near - -#endif - - -// Declaration for exported callback functions to OS -#if defined(_WIN32) - #define PEXPORTED __stdcall -#elif defined(_WINDOWS) - #define PEXPORTED WINAPI __export -#else - #define PEXPORTED __far __pascal -#endif - - -// Declaration for static global variables (WIN16 compatibility) -#if defined(_WIN32) - #define PSTATIC -#else - #define PSTATIC __near -#endif - - -// Declaration for platform independent architectures -#define PCHAR8 PANSI_CHAR -#define PBYTE_ORDER PLITTLE_ENDIAN - - -// Declaration for integer that is the same size as a void * -#if defined(_WIN32) - typedef int INT; -#else - typedef long INT; -#endif - - -// Declaration for signed integer that is 16 bits -typedef short PInt16; - -// Declaration for signed integer that is 32 bits -typedef long PInt32; - -#ifdef __MINGW32__ - #define P_HAS_INT64 - typedef signed __int64 PInt64; - typedef unsigned __int64 PUInt64; -#endif - -// Declaration for 64 bit unsigned integer quantity -#if defined(_MSC_VER) - - #define P_HAS_INT64 - - typedef signed __int64 PInt64; - typedef unsigned __int64 PUInt64; - - #if _MSC_VER<1300 - - class ostream; - class istream; - - ostream & operator<<(ostream & s, PInt64 v); - ostream & operator<<(ostream & s, PUInt64 v); - - istream & operator>>(istream & s, PInt64 & v); - istream & operator>>(istream & s, PUInt64 & v); - - #endif - -#endif - - -// Standard array index type (depends on compiler) -// Type used in array indexes especially that required by operator[] functions. -#if defined(_MSC_VER) || defined(__MINGW32__) - - #if P_64BIT - typedef size_t PINDEX; - const PINDEX P_MAX_INDEX = 0xffffffffffffffff; - inline PINDEX PABSINDEX(PINDEX idx) { return idx; } - #define PASSERTINDEX(idx) - #else - #define PINDEX int - #if defined(_WIN32) || defined(_WIN32_WCE) - const PINDEX P_MAX_INDEX = 0x7fffffff; - #else - const PINDEX P_MAX_INDEX = 0x7fff; - #endif - inline PINDEX PABSINDEX(PINDEX idx) { return (idx < 0 ? -idx : idx)&P_MAX_INDEX; } - #define PASSERTINDEX(idx) PAssert((idx) >= 0, PInvalidArrayIndex) - #endif - -#else - - #define PINDEX unsigned - #ifndef SIZEOF_INT - # define SIZEOF_INT sizeof(int) - #endif - #if SIZEOF_INT == 4 - const PINDEX P_MAX_INDEX = 0xffffffff; - #else - const PINDEX P_MAX_INDEX = 0xffff; - #endif - #define PABSINDEX(idx) (idx) - #define PASSERTINDEX(idx) - -#endif - -#ifndef _WIN32_WCE - - #if _MSC_VER>=1400 - #define strcasecmp(s1,s2) _stricmp(s1,s2) - #define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n) - #else - #define strcasecmp(s1,s2) stricmp(s1,s2) - #define strncasecmp(s1,s2,n) strnicmp(s1,s2,n) - //#define _putenv ::putenv - //#define _close ::close - //#define _access ::access - #endif - -#endif // !_WIN32_WCE - - -class PWin32Overlapped : public OVERLAPPED -{ - // Support class for overlapped I/O in Win32. - public: - PWin32Overlapped(); - ~PWin32Overlapped(); - void Reset(); -}; - - -bool PWaitForSingleObject(HANDLE handle, DWORD timeout); - - -enum { PWIN32ErrorFlag = 0x40000000 }; - -class PString; - -class RegistryKey -{ - public: - enum OpenMode { - ReadOnly, - ReadWrite, - Create - }; - RegistryKey(const PString & subkey, OpenMode mode); - ~RegistryKey(); - - BOOL EnumKey(PINDEX idx, PString & str); - BOOL EnumValue(PINDEX idx, PString & str); - BOOL DeleteKey(const PString & subkey); - BOOL DeleteValue(const PString & value); - BOOL QueryValue(const PString & value, PString & str); - BOOL QueryValue(const PString & value, DWORD & num, BOOL boolean); - BOOL SetValue(const PString & value, const PString & str); - BOOL SetValue(const PString & value, DWORD num); - private: - HKEY key; -}; - -#ifndef _WIN32_WCE - #define PDEFINE_WINMAIN(hInstance, hPrevInstance, lpCmdLine, nCmdShow) \ - int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) -#else - #define PDEFINE_WINMAIN(hInstance, hPrevInstance, lpCmdLine, nCmdShow) \ - int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -#endif -extern "C" PDEFINE_WINMAIN(hInstance, hPrevInstance, lpCmdLine, nCmdShow); - -// used by various modules to disable the winsock2 include to avoid header file problems -#ifndef P_KNOCKOUT_WINSOCK2 - - #if defined(_MSC_VER) - #pragma warning(push) - #pragma warning(disable:4127 4706) - #endif - - #include <winsock2.h> // Version 2 of windows socket - #include <ws2tcpip.h> // winsock2 is not complete, ws2tcpip add some defines such as IP_TOS - - #if defined(_MSC_VER) - #pragma warning(pop) - #endif - - typedef int socklen_t; - -#endif // P_KNOCKOUT_WINSOCK2 - -#if defined(_MSC_VER) && !defined(_WIN32) - extern "C" int __argc; - extern "C" char ** __argv; -#endif - -#ifdef __BORLANDC__ - #define __argc _argc - #define __argv _argv -#endif - -#undef Yield - -#define P_THREADIDENTIFIER DWORD - -#if defined(_MSC_VER) - #pragma warning(disable:4201) -#endif - -#include <malloc.h> -#include <mmsystem.h> - - -#ifndef _WIN32_WCE - - #ifdef _MSC_VER - #include <crtdbg.h> - #endif - #include <sys/types.h> - #include <sys/stat.h> - #include <errno.h> - #include <io.h> - #include <fcntl.h> - #include <direct.h> - #include <time.h> - -#else - - #include <ptlib/wm/stdlibx.h> - #include <ptlib/wm/errno.h> - #include <ptlib/wm/sys/types.h> - #if _WIN32_WCE < 0x500 - #include <ptlib/wm/time.h> - #else - #include <time.h> - #endif - -#ifndef MB_TASKMODAL - #define MB_TASKMODAL MB_APPLMODAL -#endif - -#endif - -// preload <string> and kill warnings -#if defined(_MSC_VER) - #pragma warning(push) - #include <yvals.h> - #pragma warning(disable:4100) - #pragma warning(disable:4018) - #pragma warning(disable:4663) - #pragma warning(disable:4146) - #pragma warning(disable:4244) - #pragma warning(disable:4786) -#endif -#include <string> -#if defined(_MSC_VER) - #pragma warning(pop) -#endif - -// preload <vector> and kill warnings -#if defined(_MSC_VER) - #pragma warning(push) - #include <yvals.h> - #pragma warning(disable:4018) - #pragma warning(disable:4663) - #pragma warning(disable:4786) -#endif -#include <vector> -#if defined(_MSC_VER) - #pragma warning(pop) -#endif - -// preload <map> and kill warnings -#if defined(_MSC_VER) - #pragma warning(push) - #include <yvals.h> - #pragma warning(disable:4018) - #pragma warning(disable:4663) - #pragma warning(disable:4786) -#endif -#include <map> -#if defined(_MSC_VER) - #pragma warning(pop) -#endif - -// preload <utility> and kill warnings -#if defined(_MSC_VER) - #pragma warning(push) - #include <yvals.h> - #pragma warning(disable:4786) -#endif -#include <utility> -#if defined(_MSC_VER) - #pragma warning(pop) -#endif - -// preload <iterator> and kill warnings -#if defined(_MSC_VER) - #pragma warning(push) - #include <yvals.h> - #pragma warning(disable:4786) -#endif -#include <iterator> -#if defined(_MSC_VER) - #pragma warning(pop) -#endif - -// preload <algorithm> and kill warnings -#include <algorithm> - -// preload <queue> and kill warnings -#if defined(_MSC_VER) - #pragma warning(push) - #include <yvals.h> - #pragma warning(disable:4284) -#endif -#include <queue> -#if defined(_MSC_VER) - #pragma warning(pop) -#endif - -#if defined(_MSC_VER) - #pragma warning(disable:4786) -#endif - - -#endif // PTLIB_MSOS_CONTAIN_H - - -// End Of File /////////////////////////////////////////////////////////////// Copied: ptlib/trunk/include/ptlib/msos/ptlib/platform.h (from rev 27065, ptlib/trunk/include/ptlib/msos/ptlib/contain.h) =================================================================== --- ptlib/trunk/include/ptlib/msos/ptlib/platform.h (rev 0) +++ ptlib/trunk/include/ptlib/msos/ptlib/platform.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -0,0 +1,456 @@ +/* + * contain.h + * + * General container classes. + * + * Portable Windows Library + * + * Copyright (c) 1993-1998 Equivalence Pty. Ltd. + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Portable Windows Library. + * + * The Initial Developer of the Original Code is Equivalence Pty. Ltd. + * + * Portions are Copyright (C) 1993 Free Software Foundation, Inc. + * All Rights Reserved. + * + * Contributor(s): ______________________________________. + * + * $Revision$ + * $Author$ + * $Date$ + */ + +#ifndef PTLIB_CONTAIN_H +#ifndef _WIN32_WCE +#error "Please remove pwlib\include\ptlib\msos from the tool include path" \ +"and from the pre-processor options for this project" +#endif // !_WIN32_WCE +#endif + +#ifndef PTLIB_MSOS_CONTAIN_H +#define PTLIB_MSOS_CONTAIN_H + + +#ifdef _MSC_VER + + #pragma warning(disable:4201) // nonstandard extension: nameless struct/union + #pragma warning(disable:4201) // nonstandard extension: nameless struct/union + #pragma warning(disable:4251) // disable warning exported structs + #pragma warning(disable:4511) // default copy ctor not generated warning + #pragma warning(disable:4512) // default assignment op not generated warning + #pragma warning(disable:4514) // unreferenced inline removed + #pragma warning(disable:4699) // precompiled headers + #pragma warning(disable:4702) // disable warning about unreachable code + #pragma warning(disable:4705) // disable warning about statement has no effect + #pragma warning(disable:4710) // inline not expanded warning + #pragma warning(disable:4711) // auto inlining warning + #pragma warning(disable:4786) // identifier was truncated to '255' characters in the debug information + #pragma warning(disable:4097) // typedef synonym for class + #pragma warning(disable:4800) // forcing value to bool 'true' or 'false' (performance warning) + + #if !defined(_CRT_SECURE_NO_DEPRECATE) && (_MSC_VER>=1400) + #define _CRT_SECURE_NO_DEPRECATE 1 + #endif + + #if !defined(_CRT_NONSTDC_NO_WARNINGS) && (_MSC_VER>=1400) + #define _CRT_NONSTDC_NO_WARNINGS 1 + #endif + +#endif // _MSC_VER + + +/////////////////////////////////////////////////////////////////////////////// +// Machine & Compiler dependent declarations + +#ifndef WIN32 + #define WIN32 1 +#endif + +#ifndef _WIN32 + #define _WIN32 1 +#endif + +#if defined(_WIN64) && !defined(P_64BIT) +#define P_64BIT 1 +#endif + +#if defined(_WINDOWS) || defined(_WIN32) + + // At least Windows 2000, configure.ac will generally uprate this + #ifndef WINVER + #define WINVER 0x0500 + #endif + + #if !defined(_WIN32_WINNT) && !defined(_WIN32_WCE) + #define _WIN32_WINNT WINVER + #endif + + #if !defined(_WIN32_WCE) && defined(_WIN32_WINNT) && (_WIN32_WINNT == 0x0500) && P_HAS_IPV6 && !defined(NTDDI_VERSION) + #define NTDDI_VERSION NTDDI_WIN2KSP1 + #endif + + #ifndef STRICT + #define STRICT + #endif + + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + + #include <windows.h> + + #undef DELETE // Remove define from NT headers. + + +#else + + typedef unsigned char BYTE; // 8 bit unsigned integer quantity + typedef unsigned short WORD; // 16 bit unsigned integer quantity + typedef unsigned long DWORD; // 32 bit unsigned integer quantity + typedef int BOOL; // type returned by expresion (i != j) + + #define TRUE 1 + #define FALSE 0 + + #define NEAR __near + +#endif + + +// Declaration for exported callback functions to OS +#if defined(_WIN32) + #define PEXPORTED __stdcall +#elif defined(_WINDOWS) + #define PEXPORTED WINAPI __export +#else + #define PEXPORTED __far __pascal +#endif + + +// Declaration for static global variables (WIN16 compatibility) +#if defined(_WIN32) + #define PSTATIC +#else + #define PSTATIC __near +#endif + + +// Declaration for platform independent architectures +#define PCHAR8 PANSI_CHAR +#define PBYTE_ORDER PLITTLE_ENDIAN + + +// Declaration for integer that is the same size as a void * +#if defined(_WIN32) + typedef int INT; +#else + typedef long INT; +#endif + + +// Declaration for signed integer that is 16 bits +typedef short PInt16; + +// Declaration for signed integer that is 32 bits +typedef long PInt32; + +#ifdef __MINGW32__ + #define P_HAS_INT64 + typedef signed __int64 PInt64; + typedef unsigned __int64 PUInt64; +#endif + +// Declaration for 64 bit unsigned integer quantity +#if defined(_MSC_VER) + + #define P_HAS_INT64 + + typedef signed __int64 PInt64; + typedef unsigned __int64 PUInt64; + + #if _MSC_VER<1300 + + class ostream; + class istream; + + ostream & operator<<(ostream & s, PInt64 v); + ostream & operator<<(ostream & s, PUInt64 v); + + istream & operator>>(istream & s, PInt64 & v); + istream & operator>>(istream & s, PUInt64 & v); + + #endif + +#endif + + +// Standard array index type (depends on compiler) +// Type used in array indexes especially that required by operator[] functions. +#if defined(_MSC_VER) || defined(__MINGW32__) + + #if P_64BIT + typedef size_t PINDEX; + const PINDEX P_MAX_INDEX = 0xffffffffffffffff; + inline PINDEX PABSINDEX(PINDEX idx) { return idx; } + #define PASSERTINDEX(idx) + #else + #define PINDEX int + #if defined(_WIN32) || defined(_WIN32_WCE) + const PINDEX P_MAX_INDEX = 0x7fffffff; + #else + const PINDEX P_MAX_INDEX = 0x7fff; + #endif + inline PINDEX PABSINDEX(PINDEX idx) { return (idx < 0 ? -idx : idx)&P_MAX_INDEX; } + #define PASSERTINDEX(idx) PAssert((idx) >= 0, PInvalidArrayIndex) + #endif + +#else + + #define PINDEX unsigned + #ifndef SIZEOF_INT + # define SIZEOF_INT sizeof(int) + #endif + #if SIZEOF_INT == 4 + const PINDEX P_MAX_INDEX = 0xffffffff; + #else + const PINDEX P_MAX_INDEX = 0xffff; + #endif + #define PABSINDEX(idx) (idx) + #define PASSERTINDEX(idx) + +#endif + +#ifndef _WIN32_WCE + + #if _MSC_VER>=1400 + #define strcasecmp(s1,s2) _stricmp(s1,s2) + #define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n) + #else + #define strcasecmp(s1,s2) stricmp(s1,s2) + #define strncasecmp(s1,s2,n) strnicmp(s1,s2,n) + //#define _putenv ::putenv + //#define _close ::close + //#define _access ::access + #endif + +#endif // !_WIN32_WCE + + +class PWin32Overlapped : public OVERLAPPED +{ + // Support class for overlapped I/O in Win32. + public: + PWin32Overlapped(); + ~PWin32Overlapped(); + void Reset(); +}; + + +bool PWaitForSingleObject(HANDLE handle, DWORD timeout); + + +enum { PWIN32ErrorFlag = 0x40000000 }; + +class PString; + +class RegistryKey +{ + public: + enum OpenMode { + ReadOnly, + ReadWrite, + Create + }; + RegistryKey(const PString & subkey, OpenMode mode); + ~RegistryKey(); + + BOOL EnumKey(PINDEX idx, PString & str); + BOOL EnumValue(PINDEX idx, PString & str); + BOOL DeleteKey(const PString & subkey); + BOOL DeleteValue(const PString & value); + BOOL QueryValue(const PString & value, PString & str); + BOOL QueryValue(const PString & value, DWORD & num, BOOL boolean); + BOOL SetValue(const PString & value, const PString & str); + BOOL SetValue(const PString & value, DWORD num); + private: + HKEY key; +}; + +#ifndef _WIN32_WCE + #define PDEFINE_WINMAIN(hInstance, hPrevInstance, lpCmdLine, nCmdShow) \ + int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +#else + #define PDEFINE_WINMAIN(hInstance, hPrevInstance, lpCmdLine, nCmdShow) \ + int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) +#endif +extern "C" PDEFINE_WINMAIN(hInstance, hPrevInstance, lpCmdLine, nCmdShow); + +// used by various modules to disable the winsock2 include to avoid header file problems +#ifndef P_KNOCKOUT_WINSOCK2 + + #if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable:4127 4706) + #endif + + #include <winsock2.h> // Version 2 of windows socket + #include <ws2tcpip.h> // winsock2 is not complete, ws2tcpip add some defines such as IP_TOS + + #if defined(_MSC_VER) + #pragma warning(pop) + #endif + + typedef int socklen_t; + +#endif // P_KNOCKOUT_WINSOCK2 + +#if defined(_MSC_VER) && !defined(_WIN32) + extern "C" int __argc; + extern "C" char ** __argv; +#endif + +#ifdef __BORLANDC__ + #define __argc _argc + #define __argv _argv +#endif + +#undef Yield + +#define P_THREADIDENTIFIER DWORD + +#if defined(_MSC_VER) + #pragma warning(disable:4201) +#endif + +#include <malloc.h> +#include <mmsystem.h> + + +#ifndef _WIN32_WCE + + #ifdef _MSC_VER + #include <crtdbg.h> + #endif + #include <sys/types.h> + #include <sys/stat.h> + #include <errno.h> + #include <io.h> + #include <fcntl.h> + #include <direct.h> + #include <time.h> + +#else + + #include <ptlib/wm/stdlibx.h> + #include <ptlib/wm/errno.h> + #include <ptlib/wm/sys/types.h> + #if _WIN32_WCE < 0x500 + #include <ptlib/wm/time.h> + #else + #include <time.h> + #endif + +#ifndef MB_TASKMODAL + #define MB_TASKMODAL MB_APPLMODAL +#endif + +#endif + +// preload <string> and kill warnings +#if defined(_MSC_VER) + #pragma warning(push) + #include <yvals.h> + #pragma warning(disable:4100) + #pragma warning(disable:4018) + #pragma warning(disable:4663) + #pragma warning(disable:4146) + #pragma warning(disable:4244) + #pragma warning(disable:4786) +#endif +#include <string> +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + +// preload <vector> and kill warnings +#if defined(_MSC_VER) + #pragma warning(push) + #include <yvals.h> + #pragma warning(disable:4018) + #pragma warning(disable:4663) + #pragma warning(disable:4786) +#endif +#include <vector> +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + +// preload <map> and kill warnings +#if defined(_MSC_VER) + #pragma warning(push) + #include <yvals.h> + #pragma warning(disable:4018) + #pragma warning(disable:4663) + #pragma warning(disable:4786) +#endif +#include <map> +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + +// preload <utility> and kill warnings +#if defined(_MSC_VER) + #pragma warning(push) + #include <yvals.h> + #pragma warning(disable:4786) +#endif +#include <utility> +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + +// preload <iterator> and kill warnings +#if defined(_MSC_VER) + #pragma warning(push) + #include <yvals.h> + #pragma warning(disable:4786) +#endif +#include <iterator> +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + +// preload <algorithm> and kill warnings +#include <algorithm> + +// preload <queue> and kill warnings +#if defined(_MSC_VER) + #pragma warning(push) + #include <yvals.h> + #pragma warning(disable:4284) +#endif +#include <queue> +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + +#if defined(_MSC_VER) + #pragma warning(disable:4786) +#endif + + +#endif // PTLIB_MSOS_CONTAIN_H + + +// End Of File /////////////////////////////////////////////////////////////// Modified: ptlib/trunk/include/ptlib/object.h =================================================================== --- ptlib/trunk/include/ptlib/object.h 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/include/ptlib/object.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -38,31 +38,32 @@ #pragma interface #endif -#if defined(_WIN32) || defined(_WIN32_WCE) -#include "msos/ptlib/contain.h" -#else -#include "unix/ptlib/contain.h" -#endif - -#if defined(P_VXWORKS) -#include <private/stdiop.h> -#endif - #include <stdio.h> #include <stdarg.h> #include <stdlib.h> - +#include <limits.h> #include <string.h> +#include <ctype.h> +#include <errno.h> #include <string> #include <iomanip> #include <iostream> #include <sstream> +#include <typeinfo> - using namespace std; // Not a good practice (name space polution), but will take too long to fix. +#if defined(_WIN32) +#include "msos/ptlib/platform.h" +#else +#include "unix/ptlib/platform.h" +#endif + + +/////////////////////////////////////////////////////////////////////////////// + #define P_REMOVE_VIRTUAL_INTERNAL_BASE(fn) __inline virtual struct ptlib_virtual_function_changed_or_removed ****** fn { return 0; } #if defined(_MSC_VER) @@ -97,14 +98,21 @@ // is also used for C translation units). // without P_USE_INTEGER_BOOL, the ANSI C++ bool is used. +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + #if defined(P_USE_INTEGER_BOOL) || !defined(__cplusplus) - typedef BOOL PBoolean; -# define PTrue TRUE -# define PFalse FALSE + typedef BOOL PBoolean; + #define PTrue TRUE + #define PFalse FALSE #else - typedef bool PBoolean; -# define PTrue true -# define PFalse false + typedef bool PBoolean; + #define PTrue true + #define PFalse false #endif @@ -1137,9 +1145,7 @@ #define PDownCast(cls, ptr) (dynamic_cast<cls*>(ptr)) #endif -#include <typeinfo> - /** Declare a class with PWLib class information. This macro is used to declare a new class with a single public ancestor. It starts the class declaration and then uses the <code>#PCLASSINFO</code> macro to Modified: ptlib/trunk/include/ptlib/pstring.h =================================================================== --- ptlib/trunk/include/ptlib/pstring.h 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/include/ptlib/pstring.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -65,15 +65,12 @@ va_list arg ///< Arguments for formatting ); -#ifdef P_HAS_WCHAR -#if (defined(_WIN32) || defined(_WIN32_WCE)) && (!defined(_NATIVE_WCHAR_T_DEFINED)) && (!defined(__MINGW32__)) -typedef PBaseArray<unsigned short> PWCharArray; -#else +#ifdef P_HAS_WCHAR +/// Wide character array, based on standard wchar_t typedef PBaseArray<wchar_t> PWCharArray; #endif -#endif /**The character string class. It supports a wealth of additional functions for string processing and conversion. Operators are provided so that @@ -1746,7 +1743,7 @@ return stream; } -#ifdef P_HAS_WCHAR +#ifdef P_HAS_WOSTREAM inline wostream & operator<<(wostream & stream, const PString & string) { return stream << (const char *)string; Deleted: ptlib/trunk/include/ptlib/unix/ptlib/contain.h =================================================================== --- ptlib/trunk/include/ptlib/unix/ptlib/contain.h 2012-02-28 03:00:04 UTC (rev 27065) +++ ptlib/trunk/include/ptlib/unix/ptlib/contain.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -1,157 +0,0 @@ -/* - * contain.h - * - * Low level object and container definitions. - * - * Portable Windows Library - * - * Copyright (c) 1993-1998 Equivalence Pty. Ltd. - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and limitations - * under the License. - * - * The Original Code is Portable Windows Library. - * - * The Initial Developer of the Original Code is Equivalence Pty. Ltd. - * - * Portions are Copyright (C) 1993 Free Software Foundation, Inc. - * All Rights Reserved. - * - * Contributor(s): ______________________________________. - * - * $Revision$ - * $Author$ - * $Date$ - */ - -#include "pmachdep.h" -#include <unistd.h> -#include <ctype.h> -#include <limits.h> -#ifdef P_OPENBSD -#include <stdint.h> -#endif - - -/////////////////////////////////////////// -// -// define TRUE and FALSE for environments that don't have them -// - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -#ifdef P_USE_INTEGER_BOOL -typedef int BOOL; -#endif - -/////////////////////////////////////////// -// -// define a macro for declaring classes so we can bolt -// extra things to class declarations -// - -#define PEXPORT -#define PSTATIC - - -/////////////////////////////////////////// -// -// define some basic types and their limits -// - -typedef int16_t PInt16; // 16 bit -typedef uint16_t PUInt16; // 16 bit -typedef int32_t PInt32; // 32 bit -typedef uint32_t PUInt32; // 32 bit - -#ifndef P_NEEDS_INT64 -typedef signed long long int PInt64; // 64 bit -typedef unsigned long long int PUInt64; // 64 bit -#endif - - -// Integer type that is same size as a pointer type. -typedef intptr_t INT; -typedef uintptr_t UINT; - -// Create "Windows" style definitions. - -typedef uint8_t BYTE; -typedef uint16_t WORD; -typedef uint32_t DWORD; - -typedef void VOID; -typedef char CHAR; - -#ifdef P_HAS_WCHAR -typedef wchar_t WCHAR; -#endif - -typedef signed char SCHAR; -typedef unsigned char UCHAR; -typedef short SHORT; -typedef signed short SSHORT; -typedef unsigned short USHORT; -typedef int16_t SWORD; -typedef uint16_t UWORD; -typedef long LONG; -typedef signed long SLONG; -typedef unsigned long ULONG; - -#if defined(__APPLE__) -typedef signed long int SDWORD; -typedef unsigned long int UDWORD; -#else -typedef int32_t SDWORD; -typedef uint32_t UDWORD; -#endif - -typedef float SFLOAT; -typedef double SDOUBLE; -typedef double LDOUBLE; - -typedef void * PTR; -typedef void * LPVOID; -typedef CHAR * LPSTR; - -#ifdef P_HAS_WCHAR -typedef WCHAR * LPWSTR; -typedef const WCHAR * LPCWSTR; -#endif - -typedef const CHAR * LPCSTR; -typedef DWORD * LPDWORD; -#define FAR - -typedef signed short RETCODE; -typedef void * HWND; - -// For sqltypes.h, prevent it from redefining the above -#define ALLREADY_HAVE_WINDOWS_TYPE 1 - -typedef SCHAR SQLSCHAR; -typedef HWND SQLHWND; -#define SQL_API - - -/////////////////////////////////////////// -// Type used for array indexes and sizes - -typedef int PINDEX; -#define P_MAX_INDEX INT_MAX - -inline PINDEX PABSINDEX(PINDEX idx) { return (idx < 0 ? -idx : idx)&P_MAX_INDEX; } -#define PASSERTINDEX(idx) PAssert((idx) >= 0, PInvalidArrayIndex) - - -// End Of File /////////////////////////////////////////////////////////////// Copied: ptlib/trunk/include/ptlib/unix/ptlib/platform.h (from rev 27065, ptlib/trunk/include/ptlib/unix/ptlib/pmachdep.h) =================================================================== --- ptlib/trunk/include/ptlib/unix/ptlib/platform.h (rev 0) +++ ptlib/trunk/include/ptlib/unix/ptlib/platform.h 2012-02-28 08:23:49 UTC (rev 27066) @@ -0,0 +1,647 @@ +/* + * platform.h + * + * Unix machine dependencies + * + * Portable Windows Library + * + * Copyright (c) 1993-1998 Equivalence Pty. Ltd. + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Portable Windows Library. + * + * The Initial Developer of the Original Code is Equivalence Pty. Ltd. + * + * Portions are Copyright (C) 1993 Free Software Foundation, Inc. + * All Rights Reserved. + * + * Contributor(s): ______________________________________. + * + * $Revision$ + * $Author$ + * $Date$ + */ + +#ifndef PTLIB_PLATFORM_H +#define PTLIB_PLATFORM_H + +/////////////////////////////////////////////////////////////////////////////// +#if defined(P_LINUX) + +#include <paths.h> +#include <signal.h> +#include <sys/ioctl.h> +#include <sys/fcntl.h> +#include <sys/termios.h> +#include <unistd.h> +#include <net/if.h> +#include <netinet/tcp.h> +#include <dlfcn.h> + +#define HAS_IFREQ + +#if __GNU_LIBRARY__ < 6 +#define P_LINUX_LIB_OLD +typedef int socklen_t; +#endif + +#ifdef PPC +typedef size_t socklen_t; +#endif + +/////////////////////////////////////////////////////////////////////////////// +#elif defined(P_FREEBSD) + +#if defined(P_PTHREADS) +#ifndef _THREAD_SAFE +#define _THREAD_SAFE +#endif +#define P_THREAD_SAFE_CLIB + +#include <pthread.h> +#endif + +#include <paths.h> +#include <dlfcn.h> +#include <termios.h> +#include <sys/fcntl.h> +#include <sys/filio.h> +#include <sys/socket.h> +#include <sys/sockio.h> +#include <sys/signal.h> +#include <net/if.h> +#include <netinet/tcp.h> + +/* socklen_t is defined in FreeBSD 3.4-STABLE, 4.0-RELEASE and above */ +#if (P_FREEBSD <= 340000) +typedef int socklen_t; +#endif + +#define HAS_IFREQ + +/////////////////////////////////////////////////////////////////////////////// +#elif defined(P_OPENBSD) + +#if defined(P_PTHREADS) +#define _THREAD_SAFE +#define P_THREAD_SAFE_CLIB + +#include <pthread.h> +#endif + +#include <paths.h> +#include <dlfcn.h> +#include <termios.h> +#include <sys/fcntl.h> +#include <sys/filio.h> +#include <sys/socket.h> +#include <sys/sockio.h> +#include <sys/ioctl.h> +#include <sys/signal.h> +#include <net/if.h> +#include <netinet/tcp.h> + +#define HAS_IFREQ + +/////////////////////////////////////////////////////////////////////////////// +#elif defined(P_NETBSD) + +#if defined(P_PTHREADS) +#define _THREAD_SAFE +#define P_THREAD_SAFE_CLIB + +#include <pthread.h> +#endif + +#include <stdlib.h> +#include <paths.h> +#include <dlfcn.h> +#include <termios.h> +#include <unistd.h> +#include <sys/fcntl.h> +#include <sys/filio.h> +#include <sys/socket.h> +#include <sys/sockio.h> +#include <sys/ioctl.h> +#include <sys/signal.h> +#include <net/if.h> +#include <netinet/tcp.h> + +#define HAS_IFREQ + +/////////////////////////////////////////////////////////////////////////////// +#elif defined(P_SOLARIS) + +#include <sys/sockio.h> +#include <sys/ioctl.h> +#include <sys/fcntl.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/termios.h> +#include <sys/socket.h> +#include <sys/ioctl.h> +#include <sys/filio.h> +#include <sys/wait.h> +#include <sys/uio.h> +#include <fcntl.h> +#include <unistd.h> +#include <net/if.h> +#include <netinet/tcp.h> +#include <dlfcn.h> +#include <net/if.h> +#include <sys/sockio.h> + +#if !defined(P_HAS_UPAD128_T) +typedef union { + long double _q; + uint32_t _l[4]; +} upad128_t; +#endif + +#if !defined(INADDR_NONE) +#define INADDR_NONE -1 +#endif +#if P_SOLARIS < 7 +typedef int socklen_t; +#endif + +#define HAS_IFREQ + +#if __GNUC__ < 3 +extern "C" { + +int ftime (struct timeb *); +pid_t wait3(int *status, int options, struct rusage *rusage); +int gethostname(char *, int); + +}; +#endif + +/////////////////////////////////////////////////////////////////////////////// +#elif defined (P_SUN4) + +#include <sys/socket.h> +#include <sys/time.h> +#include <sys/types.h> +#include <signal.h> +#include <net/if.h> +#include <sys/sockio.h> + +#define HAS_IFREQ +#define raise(s) kill(getpid(),s) + +extern "C" { + +char *mktemp(char... [truncated message content] |