Added Release With Debug Info to regex.dsp

2.
Added Release Unicode With Debug Info to regex.dsp and wxWindows.dsp

3.
Converted DS's C++ comments in regcustom.h and regex.h to C

4.
Converted defs.h and all headers it includes to C from C++ by
changing all C++ comments to C and using #ifdef __cplusplus to keep out C++-specific stuff.

5.
Changed wx_wchar to #define wx_wchar wxChar instead of copying wxchar.h code in regcustom.h.

6.
Changed the macros around a bit in regcustom.h.  Originally duplicated code from wx/defs.h.  Now uses SIZEOF_WCHAR_T to get the approriate data.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ryan Norton
2003-12-17 19:30:31 +00:00
parent a2b9e95202
commit 34cbe514cf
10 changed files with 1066 additions and 988 deletions

View File

@@ -1,3 +1,6 @@
#ifndef _REGEX_CUSTOM_H_
#define _REGEX_CUSTOM_H_
/*
* Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
*
@@ -30,10 +33,10 @@
/* headers if any */
// FreeBSD, Watcom and DMars require this, CW doesn't have nor need it.
// Others also don't seem to need it. If you have an error related to
// (not) including <sys/types.h> please report details to
// wx-dev@lists.wxwindows.org
/* FreeBSD, Watcom and DMars require this, CW doesn't have nor need it. */
/* Others also don't seem to need it. If you have an error related to */
/* (not) including <sys/types.h> please report details to */
/* wx-dev@lists.wxwindows.org */
#if defined(__UNIX__) || defined(__WATCOMC__) || defined(__DIGITALMARS__)
# include <sys/types.h>
#endif
@@ -42,23 +45,15 @@
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
#ifndef wxCHECK_GCC_VERSION
#define wxCHECK_GCC_VERSION( major, minor ) \
( defined(__GNUC__) && defined(__GNUC_MINOR__) \
&& ( ( __GNUC__ > (major) ) \
|| ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) )
#endif
#if !wxUSE_UNICODE
# define wx_wchar char
#else // Unicode
#if (defined(__GNUC__) && !wxCHECK_GCC_VERSION(2, 96))
# define wx_wchar __WCHAR_TYPE__
#else // __WCHAR_TYPE__ and gcc < 2.96
// standard case
# define wx_wchar wchar_t
#endif // __WCHAR_TYPE__
#endif // ASCII/Unicode
#include "wx/wxchar.h"
/**
*
* wx_wchar == wxChar
*
*/
#define wx_wchar wxChar
/* overrides for regguts.h definitions, if any */
#define FUNCPTR(name, args) (*name) args
@@ -78,36 +73,9 @@ typedef long celt; /* type to hold chr, MCCE number, or
* literal */
#define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */
/* RN - the "not use sizeof() thing is really annoying!" */
#if wxUSE_UNICODE
# if defined(__WINDOWS__)
# define CHRBITS 16
# define CHR_MAX 0xfffe
# else /* !__WINDOWS__ */
# if defined(__MACH__)
# define CHRBITS 32
# define CHR_MAX 0xfffffffe
# else /* !__MACH__ */
# if !defined(SIZEOF_WCHAR_T)
# define CHRBITS 16
# define CHR_MAX 0xfffe
# else /* defined(SIZEOF_WCHAR_T) */
# define CHRBITS SIZEOF_WCHAR_T
# define CHR_MAX ((1 << CHRBITS) - 1)
# endif /* !defined(SIZEOF_WCHAR_T) */
# endif /* defined(__MACH__) */
# endif /* defined(__WINDOWS__) */
#else /* !wxUSE_UNICODE */
# define CHRBITS 8 /* bits in a chr; must not use sizeof */
# define CHR_MAX 0xfe
#endif /* wxUSE_UNICODE */
#define CHRBITS (SIZEOF_WCHAR_T << 3) /* bits in a chr; must not use sizeof */
#define CHR_MAX ((1 << CHRBITS) - 1)
#define CHR_MIN 0x00000000 /* smallest and largest chr; the value */
/*
PUTTING PARENTHASES AROUND THIS, I.E. (1 << CHRBITS) WILL
CAUSE ALL CHARACTERS TO BE MATCHED!!!
*/
/*#define CHR_MAX 1 << CHRBITS / CHR_MAX-CHR_MIN+1 should fit in uchr */
/* functions operating on chr */
@@ -118,3 +86,5 @@ typedef long celt; /* type to hold chr, MCCE number, or
/* and pick up the standard header */
#include "regex.h"
#endif /* _REGEX_CUSTOM_H_ */

View File

@@ -21,6 +21,8 @@ CFG=regex - Win32 Debug Unicode
!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "regex - Win32 Release Unicode" (based on "Win32 (x86) Static Library")
!MESSAGE "regex - Win32 Debug Unicode" (based on "Win32 (x86) Static Library")
!MESSAGE "regex - Win32 Release With Debug Info" (based on "Win32 (x86) Static Library")
!MESSAGE "regex - Win32 Release Unicode With Debug Info" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
@@ -43,7 +45,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# ADD CPP /nologo /MD /W4 /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
@@ -67,7 +69,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /Gm /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W4 /Gm /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
@@ -91,7 +93,7 @@ LIB32=link.exe -lib
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /MD /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# ADD CPP /nologo /MD /W4 /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
@@ -115,7 +117,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "regex___Win32_Debug_Unicode"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /Gm /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /Gm /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W4 /Gm /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
@@ -125,6 +127,56 @@ LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\..\lib\regexd.lib"
# ADD LIB32 /nologo /out:"..\..\lib\regexud.lib"
!ELSEIF "$(CFG)" == "regex - Win32 Release With Debug Info"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "regex___Win32_Release_With_Debug_Info"
# PROP BASE Intermediate_Dir "regex___Win32_Release_With_Debug_Info"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "regex___Win32_Release_With_Debug_Info"
# PROP Intermediate_Dir "regex___Win32_Release_With_Debug_Info"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /MD /W4 /Zi /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\..\lib\regex.lib"
# ADD LIB32 /nologo /out:"..\..\lib\regex.lib"
!ELSEIF "$(CFG)" == "regex - Win32 Release Unicode With Debug Info"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "regex___Win32_Release_Unicode_With_Debug_Info"
# PROP BASE Intermediate_Dir "regex___Win32_Release_Unicode_With_Debug_Info"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "regex___Win32_Release_Unicode_With_Debug_Info"
# PROP Intermediate_Dir "regex___Win32_Release_Unicode_With_Debug_Info"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /MD /W4 /Zi /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\..\lib\regexu.lib"
# ADD LIB32 /nologo /out:"..\..\lib\regexu.lib"
!ENDIF
# Begin Target
@@ -133,6 +185,8 @@ LIB32=link.exe -lib
# Name "regex - Win32 Debug"
# Name "regex - Win32 Release Unicode"
# Name "regex - Win32 Debug Unicode"
# Name "regex - Win32 Release With Debug Info"
# Name "regex - Win32 Release Unicode With Debug Info"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

View File

@@ -1,5 +1,6 @@
#ifndef _REGEX_H_
#define _REGEX_H_ /* never again */
/*
* regular expressions
*
@@ -39,35 +40,26 @@
extern "C" {
#endif
// FreeBSD, Watcom and DMars require this, CW doesn't have nor need it.
// Others also don't seem to need it. If you have an error related to
// (not) including <sys/types.h> please report details to
// wx-dev@lists.wxwindows.org
#if defined(__UNIX__) || defined(__WATCOMC__) || defined(__DIGITALMARS__)
# include <sys/types.h>
#endif
/*****************************
WXWINDOWS CUSTOM
*****************************/
#ifndef _REGEX_CUSTOM_H_
# define wx_wchar wxChar
/* FreeBSD, Watcom and DMars require this, CW doesn't have nor need it. */
/* Others also don't seem to need it. If you have an error related to */
/* (not) including <sys/types.h> please report details to */
/* wx-dev@lists.wxwindows.org */
# if defined(__UNIX__) || defined(__WATCOMC__) || defined(__DIGITALMARS__)
# include <sys/types.h>
# endif
#endif /* ndef _REGEX_CUSTOM_H_ */
/*****************************
END WXWINDOWS CUSTOM
*****************************/
#include <stdio.h>
#include <stdlib.h>
#ifndef wxCHECK_GCC_VERSION
#define wxCHECK_GCC_VERSION( major, minor ) \
( defined(__GNUC__) && defined(__GNUC_MINOR__) \
&& ( ( __GNUC__ > (major) ) \
|| ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) )
#endif
#if !wxUSE_UNICODE
# define wx_wchar char
#else // Unicode
#if (defined(__GNUC__) && !wxCHECK_GCC_VERSION(2, 96))
# define wx_wchar __WCHAR_TYPE__
#else // __WCHAR_TYPE__ and gcc < 2.96
// standard case
# define wx_wchar wchar_t
#endif // __WCHAR_TYPE__
#endif // ASCII/Unicode
/*
* interface types etc.
*/