123
This commit is contained in:
179
STLPORT/src/MrCpp.mak
Normal file
179
STLPORT/src/MrCpp.mak
Normal file
@@ -0,0 +1,179 @@
|
||||
MAKEFILE = MrCpp.mak
|
||||
<EFBFBD>MondoBuild<EFBFBD> = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified
|
||||
|
||||
Sym-PPC = -sym on
|
||||
!ifdef DEBUG
|
||||
config_ = .PPC.DBG
|
||||
MrCpp_DebugOptions = -inline none,global -opt none {Sym-PPC}
|
||||
STL_DebugOptions = -d _STLP_DEBUG -d _STLP_DEBUG_ALLOC -d _STLP_DEBUG_UNINITIALIZED
|
||||
!else
|
||||
config_ = .PPC
|
||||
MrCpp_DebugOptions =
|
||||
STL_DebugOptions =
|
||||
!endif
|
||||
ObjDir = :{config_}:
|
||||
SrcDir = :
|
||||
|
||||
Includes = -i : -i "{STL}" -i "{CIncludes}"
|
||||
|
||||
MrCpp_Options = -ansi on -ansifor -bool on -exceptions on -rtti on -align power -j0 -traceback -opt size -inline 3,global -includes unix_mac
|
||||
|
||||
STL_Options = #-d _STLP_USE_NEWALLOC <20>
|
||||
#-d _STLP_NO_SGI_IOSTREAMS <20>
|
||||
# end
|
||||
|
||||
Link_options = <20>
|
||||
-c 'MPS ' <20>
|
||||
-mf <20>
|
||||
-d <20>
|
||||
-Linkfaster off <20>
|
||||
#{Sym-PPC} <20>
|
||||
# end
|
||||
|
||||
### Default Rules ###
|
||||
|
||||
"{ObjDir}" <EFBFBD> "{SrcDir}"
|
||||
|
||||
.cpp.x <EFBFBD> .cpp # {<7B>MondoBuild<6C>}
|
||||
###
|
||||
echo "<22>nCompiling: '"{depDir}{default}.cpp"'"
|
||||
"{MrCpp}" {depDir}{default}.cpp <20>
|
||||
-o {targDir}{default}.cpp.x <20>
|
||||
{Includes} <20>
|
||||
{MrCpp_Options} {MrCpp_DebugOptions} {other_MrCpp_Options} <20>
|
||||
{STL_Options} {STL_DebugOptions} {other_STL_Options}
|
||||
if "{status}"
|
||||
set compile_status 1
|
||||
end
|
||||
|
||||
|
||||
### Optional Dependencies ###
|
||||
|
||||
setup <EFBFBD> $OutOfDate
|
||||
###
|
||||
echo "<22>n# Target: '"{ObjDir}"'"
|
||||
unset compile_status
|
||||
if !`exists "{ObjDir}"`
|
||||
newfolder "{ObjDir}"
|
||||
end
|
||||
|
||||
|
||||
### Build this target to generate "include file" dependencies. ###
|
||||
|
||||
Dependencies <EFBFBD> $OutOfDate #*TY 02/26/2000 - MakeDepend does not work unless all mentioned include directory exists
|
||||
###
|
||||
echo "<22>nUpdating: {MAKEFILE} Dependencies"
|
||||
MakeDepend <20>
|
||||
-append {MAKEFILE} <20>
|
||||
-ignore "{CIncludes}" <20>
|
||||
-objdir "{ObjDir}" <20>
|
||||
-objext .x <20>
|
||||
{Includes} <20>
|
||||
{SrcFiles}
|
||||
|
||||
|
||||
##################################################################################
|
||||
# {stl}:src: build rule
|
||||
##################################################################################
|
||||
|
||||
### Source Files ###
|
||||
|
||||
STLportLibSrcFiles = <20>
|
||||
c_locale_stub.cpp <09>
|
||||
codecvt.cpp <09>
|
||||
collate.cpp <09>
|
||||
complex.cpp <09>
|
||||
complex_exp.cpp <09>
|
||||
complex_io.cpp <09>
|
||||
complex_io_w.cpp <09>
|
||||
complex_trig.cpp <09>
|
||||
ctype.cpp <09>
|
||||
dll_main.cpp <09>
|
||||
fstream.cpp <09>
|
||||
ios.cpp <09>
|
||||
iostream.cpp <09>
|
||||
istream.cpp <09>
|
||||
locale.cpp <09>
|
||||
locale_catalog.cpp <09>
|
||||
facets_byname.cpp <09>
|
||||
locale_impl.cpp <09>
|
||||
messages.cpp <09>
|
||||
monetary.cpp <09>
|
||||
num_get.cpp <09>
|
||||
num_get_float.cpp <09>
|
||||
num_put.cpp <09>
|
||||
num_put_float.cpp <09>
|
||||
numpunct.cpp <09>
|
||||
ostream.cpp <09>
|
||||
sstream.cpp <09>
|
||||
stdio_streambuf.cpp <09>
|
||||
streambuf.cpp <09>
|
||||
string_w.cpp <09>
|
||||
strstream.cpp <09>
|
||||
time_facets.cpp <09>
|
||||
# end #*TY 11/25/2000 - updated for STLport.4.1
|
||||
|
||||
|
||||
### Object Files ###
|
||||
|
||||
STLportLibObjFiles-PPC = <20>
|
||||
{ObjDir}c_locale_stub.cpp.x <09>
|
||||
{ObjDir}codecvt.cpp.x <09>
|
||||
{ObjDir}collate.cpp.x <09>
|
||||
{ObjDir}complex.cpp.x <09>
|
||||
{ObjDir}complex_exp.cpp.x <09>
|
||||
{ObjDir}complex_io.cpp.x <09>
|
||||
{ObjDir}complex_io_w.cpp.x <09>
|
||||
{ObjDir}complex_trig.cpp.x <09>
|
||||
{ObjDir}ctype.cpp.x <09>
|
||||
{ObjDir}dll_main.cpp.x <09>
|
||||
{ObjDir}fstream.cpp.x <09>
|
||||
{ObjDir}ios.cpp.x <09>
|
||||
{ObjDir}iostream.cpp.x <09>
|
||||
{ObjDir}istream.cpp.x <09>
|
||||
{ObjDir}locale.cpp.x <09>
|
||||
{ObjDir}locale_catalog.cpp.x <09>
|
||||
{ObjDir}facets_byname.cpp.x <09>
|
||||
{ObjDir}locale_impl.cpp.x <09>
|
||||
{ObjDir}messages.cpp.x <09>
|
||||
{ObjDir}monetary.cpp.x <09>
|
||||
{ObjDir}num_get.cpp.x <09>
|
||||
{ObjDir}num_get_float.cpp.x <09>
|
||||
{ObjDir}num_put.cpp.x <09>
|
||||
{ObjDir}num_put_float.cpp.x <09>
|
||||
{ObjDir}numpunct.cpp.x <09>
|
||||
{ObjDir}ostream.cpp.x <09>
|
||||
{ObjDir}sstream.cpp.x <09>
|
||||
{ObjDir}stdio_streambuf.cpp.x <09>
|
||||
{ObjDir}streambuf.cpp.x <09>
|
||||
{ObjDir}string_w.cpp.x <09>
|
||||
{ObjDir}strstream.cpp.x <09>
|
||||
{ObjDir}time_facets.cpp.x <09>
|
||||
# end #*TY 11/25/2000 - updated for STLport.4.1
|
||||
|
||||
|
||||
### Build Rules ###
|
||||
|
||||
build <EFBFBD><EFBFBD> setup
|
||||
build <EFBFBD><EFBFBD> "{ObjDir}"STLportLib{config_}.o
|
||||
|
||||
install <EFBFBD><EFBFBD> build
|
||||
###
|
||||
echo "<22>nInstalling: <20>{stl<74>}:lib:STLportLib{config_}.o"
|
||||
if !`exists "{stl}":lib:`
|
||||
newfolder "{stl}":lib:
|
||||
end
|
||||
duplicate -y "{ObjDir}"STLportLib{config_}.o "{stl}":lib:STLportLib{config_}.o
|
||||
|
||||
"{ObjDir}"STLportLib{config_}.o <EFBFBD><EFBFBD> {STLportLibObjFiles-PPC} {<EFBFBD>MondoBuild<EFBFBD>}
|
||||
###
|
||||
echo "<22>nLibbing: {Targ}"
|
||||
PPCLink <20>
|
||||
-xm l <20>
|
||||
-t 'XCOF' <20>
|
||||
-o {Targ} <20>
|
||||
{STLportLibObjFiles-PPC} <20>
|
||||
{Link_options} <20>
|
||||
{Sym-PPC} <20>
|
||||
# end
|
||||
|
||||
196
STLPORT/src/SCpp.mak
Normal file
196
STLPORT/src/SCpp.mak
Normal file
@@ -0,0 +1,196 @@
|
||||
MAKEFILE = SCpp.mak
|
||||
<EFBFBD>MondoBuild<EFBFBD> = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified
|
||||
|
||||
Sym-68K = -sym on
|
||||
!ifdef DEBUG
|
||||
config_ = .68K.DBG
|
||||
SCpp_DebugOptions = -inline none,global -opt none -frames {Sym-68K}
|
||||
STL_DebugOptions = -d _STLP_DEBUG -d _STLP_DEBUG_ALLOC -d _STLP_DEBUG_UNINITIALIZED
|
||||
!else
|
||||
config_ = .68K
|
||||
SCpp_DebugOptions =
|
||||
STL_DebugOptions =
|
||||
!endif
|
||||
ObjDir = :{config_}:
|
||||
SrcDir = :
|
||||
|
||||
Includes = -i : -i "{STL}" -i "{CIncludes}"
|
||||
|
||||
SCpp_Options = -model far -ansi on -ansifor -bool on -exceptions on -rtti on -b2 -mbg full -opt all -inline all,global -includes unix_mac -w 12
|
||||
|
||||
STL_Options = #-d _STLP_USE_NEWALLOC <20>
|
||||
#-d _STLP_NO_SGI_IOSTREAMS <20>
|
||||
# end
|
||||
|
||||
Link_options = <20>
|
||||
-c 'MPS ' <20>
|
||||
-mf <20>
|
||||
-d <20>
|
||||
-w <20>
|
||||
-model far <20>
|
||||
-srtsg all <20>
|
||||
#{Sym-68K} <20>
|
||||
# end
|
||||
|
||||
### Default Rules ###
|
||||
|
||||
"{ObjDir}" <EFBFBD> "{SrcDir}"
|
||||
|
||||
.cpp.o <EFBFBD> .cpp # {<7B>MondoBuild<6C>}
|
||||
###
|
||||
echo "<22>nCompiling: '"{depDir}{default}.cpp"'"
|
||||
"{SCpp}" {depDir}{default}.cpp <20>
|
||||
-o {targDir}{default}.cpp.o <20>
|
||||
-seg "{default}" <20>
|
||||
{Includes} <20>
|
||||
{SCpp_Options} {SCpp_DebugOptions} {other_SCpp_Options} <20>
|
||||
{STL_Options} {STL_DebugOptions} {other_STL_Options}
|
||||
if "{status}"
|
||||
set compile_status 1
|
||||
end
|
||||
|
||||
|
||||
### Optional Dependencies ###
|
||||
|
||||
setup <EFBFBD> $OutOfDate
|
||||
###
|
||||
echo "<22>n# Target: '"{ObjDir}"'"
|
||||
unset compile_status
|
||||
if !`exists "{ObjDir}"`
|
||||
newfolder "{ObjDir}"
|
||||
end
|
||||
|
||||
|
||||
### Build this target to generate "include file" dependencies. ###
|
||||
|
||||
Dependencies <EFBFBD> $OutOfDate #*TY 02/26/2000 - MakeDepend does not work unless all mentioned include directory exists
|
||||
###
|
||||
echo "<22>nUpdating: {MAKEFILE} Dependencies"
|
||||
MakeDepend <20>
|
||||
-append {MAKEFILE} <20>
|
||||
-ignore "{CIncludes}" <20>
|
||||
-objdir "{ObjDir}" <20>
|
||||
-objext .x <20>
|
||||
{Includes} <20>
|
||||
{SrcFiles}
|
||||
|
||||
|
||||
##################################################################################
|
||||
# {stl}:src: build rule
|
||||
##################################################################################
|
||||
|
||||
### Source Files ###
|
||||
|
||||
STLportLibSrcFiles = <20>
|
||||
c_locale_stub.cpp <09>
|
||||
codecvt.cpp <09>
|
||||
collate.cpp <09>
|
||||
complex.cpp <09>
|
||||
complex_exp.cpp <09>
|
||||
complex_io.cpp <09>
|
||||
complex_io_w.cpp <09>
|
||||
complex_trig.cpp <09>
|
||||
ctype.cpp <09>
|
||||
dll_main.cpp <09>
|
||||
fstream.cpp <09>
|
||||
ios.cpp <09>
|
||||
iostream.cpp <09>
|
||||
istream.cpp <09>
|
||||
locale.cpp <09>
|
||||
locale_catalog.cpp <09>
|
||||
facets_byname.cpp <09>
|
||||
locale_impl.cpp <09>
|
||||
messages.cpp <09>
|
||||
monetary.cpp <09>
|
||||
num_get.cpp <09>
|
||||
num_get_float.cpp <09>
|
||||
num_put.cpp <09>
|
||||
num_put_float.cpp <09>
|
||||
numpunct.cpp <09>
|
||||
ostream.cpp <09>
|
||||
sstream.cpp <09>
|
||||
stdio_streambuf.cpp <09>
|
||||
streambuf.cpp <09>
|
||||
string_w.cpp <09>
|
||||
strstream.cpp <09>
|
||||
time_facets.cpp <09>
|
||||
# end #*TY 11/25/2000 - updated for STLport.4.1
|
||||
|
||||
|
||||
### Object Files ###
|
||||
|
||||
STLportLibObjFiles1-68K = <20>
|
||||
{ObjDir}c_locale_stub.cpp.o <09>
|
||||
{ObjDir}codecvt.cpp.o <09>
|
||||
{ObjDir}collate.cpp.o <09>
|
||||
{ObjDir}complex.cpp.o <09>
|
||||
{ObjDir}complex_exp.cpp.o <09>
|
||||
{ObjDir}complex_io.cpp.o <09>
|
||||
{ObjDir}complex_io_w.cpp.o <09>
|
||||
{ObjDir}complex_trig.cpp.o <09>
|
||||
{ObjDir}ctype.cpp.o <09>
|
||||
{ObjDir}dll_main.cpp.o <09>
|
||||
{ObjDir}fstream.cpp.o <09>
|
||||
{ObjDir}ios.cpp.o <09>
|
||||
{ObjDir}iostream.cpp.o <09>
|
||||
{ObjDir}istream.cpp.o <09>
|
||||
{ObjDir}locale.cpp.o <09>
|
||||
{ObjDir}locale_catalog.cpp.o <09>
|
||||
#
|
||||
STLportLibObjFiles2-68K = <20>
|
||||
{ObjDir}facets_byname.cpp.o <09>
|
||||
{ObjDir}locale_impl.cpp.o <09>
|
||||
{ObjDir}messages.cpp.o <09>
|
||||
{ObjDir}monetary.cpp.o <09>
|
||||
{ObjDir}num_get.cpp.o <09>
|
||||
{ObjDir}num_get_float.cpp.o <09>
|
||||
{ObjDir}num_put.cpp.o <09>
|
||||
{ObjDir}num_put_float.cpp.o <09>
|
||||
{ObjDir}numpunct.cpp.o <09>
|
||||
{ObjDir}ostream.cpp.o <09>
|
||||
{ObjDir}sstream.cpp.o <09>
|
||||
{ObjDir}stdio_streambuf.cpp.o <09>
|
||||
{ObjDir}streambuf.cpp.o <09>
|
||||
{ObjDir}string_w.cpp.o <09>
|
||||
{ObjDir}strstream.cpp.o <09>
|
||||
{ObjDir}time_facets.cpp.o <09>
|
||||
# end #*TY 11/25/2000 - updated for STLport.4.1
|
||||
|
||||
|
||||
### Build Rules ###
|
||||
|
||||
build <EFBFBD><EFBFBD> setup
|
||||
build <EFBFBD><EFBFBD> "{ObjDir}"STLportLib{config_}.o
|
||||
|
||||
"{ObjDir}"STLportLib{config_}.o <EFBFBD><EFBFBD> {STLportLibObjFiles1-68K} {STLportLibObjFiles2-68K} {<EFBFBD>MondoBuild<EFBFBD>}
|
||||
###
|
||||
echo "<22>nLibbing: {Targ}"
|
||||
Lib <20>
|
||||
-o "{ObjDir}"STLportLib1{config_}.o <20>
|
||||
{STLportLibObjFiles1-68K} <20>
|
||||
-mf <20>
|
||||
-d <20>
|
||||
-sym on <20>
|
||||
# end
|
||||
Lib <20>
|
||||
-o "{ObjDir}"STLportLib2{config_}.o <20>
|
||||
{STLportLibObjFiles2-68K} <20>
|
||||
-mf <20>
|
||||
-d <20>
|
||||
-sym on <20>
|
||||
# end
|
||||
Lib <20>
|
||||
-o {Targ} <20>
|
||||
"{ObjDir}"STLportLib1{config_}.o "{ObjDir}"STLportLib2{config_}.o <20>
|
||||
-mf <20>
|
||||
-d <20>
|
||||
-sym on <20>
|
||||
# end
|
||||
|
||||
install <EFBFBD><EFBFBD> build
|
||||
###
|
||||
echo "<22>nInstalling: <20>{stl<74>}:lib:STLportLib{config_}.o"
|
||||
if !`exists "{stl}":lib:`
|
||||
newfolder "{stl}":lib:
|
||||
end
|
||||
duplicate -y "{ObjDir}"STLportLib{config_}.o "{stl}":lib:STLportLib{config_}.o
|
||||
13
STLPORT/src/aligned_buffer.h
Normal file
13
STLPORT/src/aligned_buffer.h
Normal file
@@ -0,0 +1,13 @@
|
||||
# ifndef ALIGNED_BUFFER_H
|
||||
# define ALIGNED_BUFFER_H
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
// this is for fake initialization
|
||||
template<class T>
|
||||
union _Stl_aligned_buffer {
|
||||
char buf[sizeof(T)];
|
||||
struct { double a; double b; } padding;
|
||||
};
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
# endif
|
||||
234
STLPORT/src/bc502.mak
Normal file
234
STLPORT/src/bc502.mak
Normal file
@@ -0,0 +1,234 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
CPP=cpp32
|
||||
CC=bcc32 -P
|
||||
CXX=bcc32
|
||||
|
||||
RC=brc32
|
||||
COMP=BCC502
|
||||
|
||||
LIB_BASENAME=stlport_bcb
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
LINK_OUT=
|
||||
DYNLINK_OUT=
|
||||
LINK = tlib /P128
|
||||
DYN_LINK = ilink32
|
||||
OBJEXT=obj
|
||||
DYNEXT=dll
|
||||
STEXT=lib
|
||||
RM=@erase /F /Q
|
||||
PATH_SEP=\\
|
||||
MKDIR=mkdir
|
||||
STATIC_SUFFIX=_static
|
||||
INSTALL_STEP=install_bc
|
||||
|
||||
# static builds, but cannot be used - some weird compile errors..
|
||||
all : all_dynamic
|
||||
|
||||
!include common_macros_windows.mak
|
||||
|
||||
DYNAMIC_DEFS=_RTLDLL
|
||||
STATIC_DEFS=_LIB;_STLP_NO_FORCE_INSTANTIATE
|
||||
|
||||
LINKSTARTUP= c0d32.obj
|
||||
|
||||
FLAGS_COMMON= -I.;..\stlport\BC50;..\stlport;$(BCB)\include -j1 -w -c -w-par -w-inl -tWM
|
||||
FLAGS_COMMON_static = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(STATIC_DEFS)
|
||||
FLAGS_COMMON_dynamic = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(DYNAMIC_DEFS) -tWD
|
||||
|
||||
LDFLAGS_COMMON=-Gn -Gi -Tpd -aa -L$(MAKEDIR)\..\lib -x
|
||||
LDFLAGS_COMMON_static= $(LDFLAGS_COMMON)
|
||||
LDFLAGS_COMMON_dynamic= $(LDFLAGS_COMMON)
|
||||
|
||||
|
||||
LDFLAGS_RELEASE_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
|
||||
LDFLAGS_RELEASE_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
|
||||
LDLIBS_RELEASE_dynamic= import32.lib cw32mti.lib
|
||||
LDLIBS_DEBUG_dynamic= import32.lib cw32mti.lib
|
||||
LDLIBS_STLDEBUG_dynamic= import32.lib cw32mti.lib
|
||||
|
||||
|
||||
CXXFLAGS_RELEASE_static= $(FLAGS_COMMON_static) -O2 -n$(RELEASE_OBJDIR_static)
|
||||
CXXFLAGS_DEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(DEBUG_OBJDIR_static)
|
||||
CXXFLAGS_STLDEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(STLDEBUG_OBJDIR_static) -D_STLP_DEBUG
|
||||
|
||||
CXXFLAGS_RELEASE_dynamic= $(FLAGS_COMMON_dynamic) -O2 -n$(RELEASE_OBJDIR_dynamic)
|
||||
CXXFLAGS_DEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(DEBUG_OBJDIR_dynamic)
|
||||
CXXFLAGS_STLDEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(STLDEBUG_OBJDIR_dynamic) -D_STLP_DEBUG
|
||||
|
||||
RELEASE_LINK_COMMANDS_static=\
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
|
||||
DEBUG_LINK_COMMANDS_static= \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
STLDEBUG_LINK_COMMANDS_static= \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
#
|
||||
# Target directories
|
||||
#
|
||||
#
|
||||
|
||||
$(OUTDIR) :
|
||||
$(MKDIR) $(OUTDIR)
|
||||
$(RELEASE_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_dynamic)
|
||||
$(DEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_dynamic)
|
||||
$(STLDEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_dynamic)
|
||||
$(RELEASE_OBJDIR_static) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_static)
|
||||
$(DEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_static)
|
||||
$(STLDEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_static)
|
||||
|
||||
###### Targets ##################
|
||||
|
||||
all_static : $(ALL_STATIC_LIBS)
|
||||
|
||||
all_dynamic : $(ALL_DYNAMIC_LIBS)
|
||||
|
||||
install : $(INSTALL_STEP)
|
||||
|
||||
clean : $(CLEAN_SPECIFIC)
|
||||
-$(RM) $(RELEASE_OBJDIR_static) $(DEBUG_OBJDIR_static) \
|
||||
$(STLDEBUG_OBJDIR_static) $(RELEASE_OBJDIR_dynamic) \
|
||||
$(DEBUG_OBJDIR_dynamic) $(STLDEBUG_OBJDIR_dynamic)
|
||||
|
||||
clobber : clean
|
||||
-$(RM) $(OUTDIR)$(PATH_SEP)$(DEBUG_NAME).* \
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_NAME).* $(OUTDIR)$(PATH_SEP)$(STLDEBUG_NAME).*
|
||||
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) : $(OUTDIR) $(RELEASE_OBJDIR_dynamic) $(DEF_FILE) $(RELEASE_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_RELEASE_dynamic) $(RELEASE_OBJECTS_dynamic) , $(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB),,$(LDLIBS_RELEASE_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) : $(OUTDIR) $(DEBUG_OBJDIR_dynamic) $(DEF_FILE) $(DEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_DEBUG_dynamic) $(DEBUG_OBJECTS_dynamic), $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) ,, $(LDLIBS_DEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) : $(OUTDIR) $(STLDEBUG_OBJDIR_dynamic) $(DEF_FILE) $(STLDEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_STLDEBUG_dynamic) $(STLDEBUG_OBJECTS_dynamic) , $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) ,, $(LDLIBS_STLDEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) : $(OUTDIR) $(RELEASE_OBJDIR_static) $(DEF_FILE) $(RELEASE_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) $(RELEASE_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) : $(OUTDIR) $(DEBUG_OBJDIR_static) $(DEF_FILE) $(DEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) $(DEBUG_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) : $(OUTDIR) $(STLDEBUG_OBJDIR_static) $(DEF_FILE) $(STLDEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) $(STLDEBUG_LINK_COMMANDS_static)
|
||||
|
||||
#########################################
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
!include nmake_common.mak
|
||||
|
||||
.cpp.i:
|
||||
$(CPP) $(CXXFLAGS_RELEASE_dynamic) -n. -Sr -Ss -Sd {$< }
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
253
STLPORT/src/bcb.mak
Normal file
253
STLPORT/src/bcb.mak
Normal file
@@ -0,0 +1,253 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
!if !$d(BCB)
|
||||
BCB = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
CPP=cpp32
|
||||
CC=bcc32 -P
|
||||
CXX=bcc32
|
||||
|
||||
RC=brc32
|
||||
COMP=BCB
|
||||
|
||||
LIB_BASENAME=stlp
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
LINK_OUT=
|
||||
DYNLINK_OUT=
|
||||
LINK = tlib /P256
|
||||
# Use objs in RTL build tree
|
||||
DYN_LINK = ilink32 -L$(BCB)\lib
|
||||
OBJEXT=obj
|
||||
DYNEXT=dll
|
||||
STEXT=lib
|
||||
# We use 4NT, which does not know about /Q
|
||||
#RM=-rd /S /Q
|
||||
RM=-rd /S
|
||||
PATH_SEP=\\
|
||||
MKDIR=-mkdir
|
||||
STATIC_SUFFIX=st
|
||||
INSTALL_STEP=install_bc
|
||||
|
||||
all : platform all_dynamic all_static
|
||||
|
||||
!include common_macros_windows.mak
|
||||
|
||||
#RM=-rd /S /Q
|
||||
RM=-rd /S
|
||||
MKDIR=-mkdir
|
||||
|
||||
DYNAMIC_DEFS=_RTLDLL;_WIN32;_DLL;_STLP_DESIGNATED_DLL
|
||||
STATIC_DEFS=_LIB;_WIN32;_STLP_NO_FORCE_INSTANTIATE
|
||||
|
||||
LINKSTARTUP= c0d32.obj
|
||||
|
||||
FLAGS_COMMON= -I.;..\stlport;$(BCB)\include;$(BCB)\include\windows -jb -j1 -w -c -w-par -w-inl -w-stl
|
||||
FLAGS_COMMON_static = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(STATIC_DEFS)
|
||||
FLAGS_COMMON_dynamic = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(DYNAMIC_DEFS) -tWDR
|
||||
|
||||
# -L$(MAKEDIR)\..\lib removed ...it should get ilink32.cfg values instead
|
||||
LDFLAGS_COMMON=-Gn -Gi -Tpd -aa -x
|
||||
LDFLAGS_COMMON_static= $(LDFLAGS_COMMON)
|
||||
LDFLAGS_COMMON_dynamic= $(LDFLAGS_COMMON)
|
||||
|
||||
|
||||
LDFLAGS_RELEASE_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
|
||||
LDFLAGS_RELEASE_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
|
||||
LDLIBS_RELEASE_dynamic= import32.lib cw32i.lib
|
||||
LDLIBS_DEBUG_dynamic= import32.lib cw32i.lib
|
||||
LDLIBS_STLDEBUG_dynamic= import32.lib cw32i.lib
|
||||
|
||||
|
||||
CXXFLAGS_RELEASE_static= $(FLAGS_COMMON_static) -O2 -n$(RELEASE_OBJDIR_static)
|
||||
CXXFLAGS_DEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(DEBUG_OBJDIR_static)
|
||||
CXXFLAGS_STLDEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(STLDEBUG_OBJDIR_static) -D_STLP_DEBUG
|
||||
|
||||
CXXFLAGS_RELEASE_dynamic= $(FLAGS_COMMON_dynamic) -O2 -n$(RELEASE_OBJDIR_dynamic)
|
||||
CXXFLAGS_DEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(DEBUG_OBJDIR_dynamic)
|
||||
CXXFLAGS_STLDEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(STLDEBUG_OBJDIR_dynamic) -D_STLP_DEBUG
|
||||
|
||||
RELEASE_LINK_COMMANDS_static=\
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
|
||||
DEBUG_LINK_COMMANDS_static= \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
STLDEBUG_LINK_COMMANDS_static= \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
#
|
||||
# Target directories
|
||||
#
|
||||
#
|
||||
|
||||
$(RELEASE_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_dynamic)
|
||||
$(DEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_dynamic)
|
||||
$(STLDEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_dynamic)
|
||||
$(RELEASE_OBJDIR_static) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_static)
|
||||
$(DEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_static)
|
||||
$(STLDEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_static)
|
||||
|
||||
###### Targets ##################
|
||||
|
||||
all_static : $(ALL_STATIC_LIBS)
|
||||
|
||||
all_dynamic : $(ALL_DYNAMIC_LIBS)
|
||||
|
||||
install : $(INSTALL_STEP)
|
||||
|
||||
clean : $(CLEAN_SPECIFIC)
|
||||
-$(RM) $(RELEASE_OBJDIR_static) $(DEBUG_OBJDIR_static) \
|
||||
$(STLDEBUG_OBJDIR_static) $(RELEASE_OBJDIR_dynamic) \
|
||||
$(DEBUG_OBJDIR_dynamic) $(STLDEBUG_OBJDIR_dynamic)
|
||||
|
||||
clobber : clean
|
||||
-$(RM) $(OUTDIR)$(PATH_SEP)$(DEBUG_NAME).* \
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_NAME).* $(OUTDIR)$(PATH_SEP)$(STLDEBUG_NAME).*
|
||||
|
||||
#create a compiler platform directory
|
||||
platform:
|
||||
-$(MKDIR) $(OBJDIR_COMMON)
|
||||
-$(MKDIR) $(OBJDIR)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) : $(RELEASE_OBJDIR_dynamic) $(DEF_FILE) $(RELEASE_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_RELEASE_dynamic) $(RELEASE_OBJECTS_dynamic) , $(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB),,$(LDLIBS_RELEASE_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) : $(DEBUG_OBJDIR_dynamic) $(DEF_FILE) $(DEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_DEBUG_dynamic) $(DEBUG_OBJECTS_dynamic), $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) ,, $(LDLIBS_DEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) : $(STLDEBUG_OBJDIR_dynamic) $(DEF_FILE) $(STLDEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_STLDEBUG_dynamic) $(STLDEBUG_OBJECTS_dynamic) , $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) ,, $(LDLIBS_STLDEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) : $(RELEASE_OBJDIR_static) $(DEF_FILE) $(RELEASE_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) $(RELEASE_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) : $(DEBUG_OBJDIR_static) $(DEF_FILE) $(DEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) $(DEBUG_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) : $(STLDEBUG_OBJDIR_static) $(DEF_FILE) $(STLDEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) $(STLDEBUG_LINK_COMMANDS_static)
|
||||
|
||||
#########################################
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
!include nmake_common.mak
|
||||
|
||||
.cpp.i:
|
||||
$(CPP) $(CXXFLAGS_DEBUG_dynamic) -n. -Sr -Ss -Sd {$< }
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
253
STLPORT/src/bcb55.mak
Normal file
253
STLPORT/src/bcb55.mak
Normal file
@@ -0,0 +1,253 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
!if !$d(BCB)
|
||||
BCB = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
CPP=cpp32
|
||||
CC=bcc32 -P
|
||||
CXX=bcc32
|
||||
|
||||
RC=brc32
|
||||
COMP=BCB
|
||||
|
||||
LIB_BASENAME=stlp
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
LINK_OUT=
|
||||
DYNLINK_OUT=
|
||||
LINK = tlib /P256
|
||||
# Use objs in RTL build tree
|
||||
DYN_LINK = ilink32 -L$(BCB)\lib
|
||||
OBJEXT=obj
|
||||
DYNEXT=dll
|
||||
STEXT=lib
|
||||
# We use 4NT, which does not know about /Q
|
||||
#RM=-rd /S /Q
|
||||
RM=-rd /S
|
||||
PATH_SEP=\\
|
||||
MKDIR=-md
|
||||
STATIC_SUFFIX=st
|
||||
INSTALL_STEP=install_bc
|
||||
|
||||
all : platform all_dynamic all_static
|
||||
|
||||
!include common_macros_windows.mak
|
||||
|
||||
#RM=-rd /S /Q
|
||||
RM=-rd /S
|
||||
MKDIR=-md
|
||||
|
||||
DYNAMIC_DEFS=_RTLDLL;_WIN32;_DLL;_STLP_DESIGNATED_DLL
|
||||
STATIC_DEFS=_LIB;_WIN32;_STLP_NO_FORCE_INSTANTIATE
|
||||
|
||||
LINKSTARTUP= c0d32.obj
|
||||
|
||||
FLAGS_COMMON= -I.;..\stlport;$(BCB)\include;$(BCB)\include\windows -jb -j1 -w -c -w-par -w-inl -w-stl
|
||||
FLAGS_COMMON_static = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(STATIC_DEFS)
|
||||
FLAGS_COMMON_dynamic = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(DYNAMIC_DEFS) -tWDR
|
||||
|
||||
# -L$(MAKEDIR)\..\lib removed ...it should get ilink32.cfg values instead
|
||||
LDFLAGS_COMMON=-Gn -Gi -Tpd -aa -x
|
||||
LDFLAGS_COMMON_static= $(LDFLAGS_COMMON)
|
||||
LDFLAGS_COMMON_dynamic= $(LDFLAGS_COMMON)
|
||||
|
||||
|
||||
LDFLAGS_RELEASE_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
|
||||
LDFLAGS_RELEASE_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
|
||||
LDLIBS_RELEASE_dynamic= import32.lib cw32i.lib
|
||||
LDLIBS_DEBUG_dynamic= import32.lib cw32i.lib
|
||||
LDLIBS_STLDEBUG_dynamic= import32.lib cw32i.lib
|
||||
|
||||
|
||||
CXXFLAGS_RELEASE_static= $(FLAGS_COMMON_static) -O2 -n$(RELEASE_OBJDIR_static)
|
||||
CXXFLAGS_DEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(DEBUG_OBJDIR_static)
|
||||
CXXFLAGS_STLDEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(STLDEBUG_OBJDIR_static) -D_STLP_DEBUG
|
||||
|
||||
CXXFLAGS_RELEASE_dynamic= $(FLAGS_COMMON_dynamic) -O2 -n$(RELEASE_OBJDIR_dynamic)
|
||||
CXXFLAGS_DEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(DEBUG_OBJDIR_dynamic)
|
||||
CXXFLAGS_STLDEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(STLDEBUG_OBJDIR_dynamic) -D_STLP_DEBUG
|
||||
|
||||
RELEASE_LINK_COMMANDS_static=\
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
|
||||
DEBUG_LINK_COMMANDS_static= \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
STLDEBUG_LINK_COMMANDS_static= \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
#
|
||||
# Target directories
|
||||
#
|
||||
#
|
||||
|
||||
$(RELEASE_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_dynamic)
|
||||
$(DEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_dynamic)
|
||||
$(STLDEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_dynamic)
|
||||
$(RELEASE_OBJDIR_static) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_static)
|
||||
$(DEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_static)
|
||||
$(STLDEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_static)
|
||||
|
||||
###### Targets ##################
|
||||
|
||||
all_static : $(ALL_STATIC_LIBS)
|
||||
|
||||
all_dynamic : $(ALL_DYNAMIC_LIBS)
|
||||
|
||||
install : $(INSTALL_STEP)
|
||||
|
||||
clean : $(CLEAN_SPECIFIC)
|
||||
-$(RM) $(RELEASE_OBJDIR_static) $(DEBUG_OBJDIR_static) \
|
||||
$(STLDEBUG_OBJDIR_static) $(RELEASE_OBJDIR_dynamic) \
|
||||
$(DEBUG_OBJDIR_dynamic) $(STLDEBUG_OBJDIR_dynamic)
|
||||
|
||||
clobber : clean
|
||||
-$(RM) $(OUTDIR)$(PATH_SEP)$(DEBUG_NAME).* \
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_NAME).* $(OUTDIR)$(PATH_SEP)$(STLDEBUG_NAME).*
|
||||
|
||||
#create a compiler platform directory
|
||||
platform:
|
||||
-$(MKDIR) $(OBJDIR_COMMON)
|
||||
-$(MKDIR) $(OBJDIR)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) : $(RELEASE_OBJDIR_dynamic) $(DEF_FILE) $(RELEASE_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_RELEASE_dynamic) $(RELEASE_OBJECTS_dynamic) , $(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB),,$(LDLIBS_RELEASE_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) : $(DEBUG_OBJDIR_dynamic) $(DEF_FILE) $(DEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_DEBUG_dynamic) $(DEBUG_OBJECTS_dynamic), $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) ,, $(LDLIBS_DEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) : $(STLDEBUG_OBJDIR_dynamic) $(DEF_FILE) $(STLDEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_STLDEBUG_dynamic) $(STLDEBUG_OBJECTS_dynamic) , $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) ,, $(LDLIBS_STLDEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) : $(RELEASE_OBJDIR_static) $(DEF_FILE) $(RELEASE_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) $(RELEASE_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) : $(DEBUG_OBJDIR_static) $(DEF_FILE) $(DEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) $(DEBUG_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) : $(STLDEBUG_OBJDIR_static) $(DEF_FILE) $(STLDEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) $(STLDEBUG_LINK_COMMANDS_static)
|
||||
|
||||
#########################################
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
!include nmake_common.mak
|
||||
|
||||
.cpp.i:
|
||||
$(CPP) $(CXXFLAGS_DEBUG_dynamic) -n. -Sr -Ss -Sd {$< }
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
254
STLPORT/src/bcb60.mak
Normal file
254
STLPORT/src/bcb60.mak
Normal file
@@ -0,0 +1,254 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
!if !$d(BCB)
|
||||
BCB = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
CPP=cpp32
|
||||
CC=bcc32 -P
|
||||
CXX=bcc32
|
||||
|
||||
RC=brc32
|
||||
COMP=BCB
|
||||
|
||||
LIB_BASENAME=stlp
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
LINK_OUT=
|
||||
DYNLINK_OUT=
|
||||
LINK = tlib /P256
|
||||
# Use objs in RTL build tree
|
||||
DYN_LINK = ilink32 -L$(BCB)\lib
|
||||
OBJEXT=obj
|
||||
DYNEXT=dll
|
||||
STEXT=lib
|
||||
# We use 4NT, which does not know about /Q
|
||||
#RM=-rd /S /Q
|
||||
RM=-rd /S
|
||||
PATH_SEP=\\
|
||||
MKDIR=-md
|
||||
STATIC_SUFFIX=st
|
||||
INSTALL_STEP=install_bc
|
||||
|
||||
all : platform all_dynamic all_static
|
||||
|
||||
!include common_macros_windows.mak
|
||||
|
||||
#RM=-rd /S /Q
|
||||
RM=-rd /S
|
||||
MKDIR=-md
|
||||
|
||||
DYNAMIC_DEFS=_RTLDLL;_WIN32;_DLL;_STLP_DESIGNATED_DLL
|
||||
STATIC_DEFS=_LIB;_WIN32;_STLP_NO_FORCE_INSTANTIATE;_STLP_DESIGNATED_DLL
|
||||
|
||||
LINKSTARTUP= c0d32.obj
|
||||
|
||||
FLAGS_COMMON= -I.;..\stlport;$(BCB)\include;$(BCB)\include\windows -jb -j1 -w -c -w-par -w-inl -w-stl
|
||||
|
||||
FLAGS_COMMON_static = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(STATIC_DEFS)
|
||||
FLAGS_COMMON_dynamic = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(DYNAMIC_DEFS) -tWDR
|
||||
|
||||
# -L$(MAKEDIR)\..\lib removed ...it should get ilink32.cfg values instead
|
||||
LDFLAGS_COMMON=-Gn -Gi -Tpd -aa -x
|
||||
LDFLAGS_COMMON_static= $(LDFLAGS_COMMON)
|
||||
LDFLAGS_COMMON_dynamic= $(LDFLAGS_COMMON)
|
||||
|
||||
|
||||
LDFLAGS_RELEASE_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
|
||||
LDFLAGS_RELEASE_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
|
||||
LDLIBS_RELEASE_dynamic= import32.lib cw32i.lib
|
||||
LDLIBS_DEBUG_dynamic= import32.lib cw32i.lib
|
||||
LDLIBS_STLDEBUG_dynamic= import32.lib cw32i.lib
|
||||
|
||||
|
||||
CXXFLAGS_RELEASE_static= $(FLAGS_COMMON_static) -O2 -n$(RELEASE_OBJDIR_static)
|
||||
CXXFLAGS_DEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(DEBUG_OBJDIR_static)
|
||||
CXXFLAGS_STLDEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(STLDEBUG_OBJDIR_static) -D_STLP_DEBUG
|
||||
|
||||
CXXFLAGS_RELEASE_dynamic= $(FLAGS_COMMON_dynamic) -O2 -n$(RELEASE_OBJDIR_dynamic)
|
||||
CXXFLAGS_DEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(DEBUG_OBJDIR_dynamic)
|
||||
CXXFLAGS_STLDEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(STLDEBUG_OBJDIR_dynamic) -D_STLP_DEBUG
|
||||
|
||||
RELEASE_LINK_COMMANDS_static=\
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
|
||||
DEBUG_LINK_COMMANDS_static= \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
STLDEBUG_LINK_COMMANDS_static= \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
#
|
||||
# Target directories
|
||||
#
|
||||
#
|
||||
|
||||
$(RELEASE_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_dynamic)
|
||||
$(DEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_dynamic)
|
||||
$(STLDEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_dynamic)
|
||||
$(RELEASE_OBJDIR_static) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_static)
|
||||
$(DEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_static)
|
||||
$(STLDEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_static)
|
||||
|
||||
###### Targets ##################
|
||||
|
||||
all_static : $(ALL_STATIC_LIBS)
|
||||
|
||||
all_dynamic : $(ALL_DYNAMIC_LIBS)
|
||||
|
||||
install : $(INSTALL_STEP)
|
||||
|
||||
clean : $(CLEAN_SPECIFIC)
|
||||
-$(RM) $(RELEASE_OBJDIR_static) $(DEBUG_OBJDIR_static) \
|
||||
$(STLDEBUG_OBJDIR_static) $(RELEASE_OBJDIR_dynamic) \
|
||||
$(DEBUG_OBJDIR_dynamic) $(STLDEBUG_OBJDIR_dynamic)
|
||||
|
||||
clobber : clean
|
||||
-$(RM) $(OUTDIR)$(PATH_SEP)$(DEBUG_NAME).* \
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_NAME).* $(OUTDIR)$(PATH_SEP)$(STLDEBUG_NAME).*
|
||||
|
||||
#create a compiler platform directory
|
||||
platform:
|
||||
-$(MKDIR) $(OBJDIR_COMMON)
|
||||
-$(MKDIR) $(OBJDIR)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) : $(RELEASE_OBJDIR_dynamic) $(DEF_FILE) $(RELEASE_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_RELEASE_dynamic) $(RELEASE_OBJECTS_dynamic) , $(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB),,$(LDLIBS_RELEASE_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) : $(DEBUG_OBJDIR_dynamic) $(DEF_FILE) $(DEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_DEBUG_dynamic) $(DEBUG_OBJECTS_dynamic), $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) ,, $(LDLIBS_DEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) : $(STLDEBUG_OBJDIR_dynamic) $(DEF_FILE) $(STLDEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_STLDEBUG_dynamic) $(STLDEBUG_OBJECTS_dynamic) , $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) ,, $(LDLIBS_STLDEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) : $(RELEASE_OBJDIR_static) $(DEF_FILE) $(RELEASE_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) $(RELEASE_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) : $(DEBUG_OBJDIR_static) $(DEF_FILE) $(DEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) $(DEBUG_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) : $(STLDEBUG_OBJDIR_static) $(DEF_FILE) $(STLDEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) $(STLDEBUG_LINK_COMMANDS_static)
|
||||
|
||||
#########################################
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
!include nmake_common.mak
|
||||
|
||||
.cpp.i:
|
||||
$(CPP) $(FLAGS_COMMON_static) -n. -Sr -Ss -Sd {$< }
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
253
STLPORT/src/bcb60mt.mak
Normal file
253
STLPORT/src/bcb60mt.mak
Normal file
@@ -0,0 +1,253 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
!if !$d(BCB)
|
||||
BCB = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
CPP=cpp32
|
||||
CC=bcc32 -P
|
||||
CXX=bcc32
|
||||
|
||||
RC=brc32
|
||||
COMP=BCB60MT
|
||||
|
||||
LIB_BASENAME=stlpmt
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
LINK_OUT=
|
||||
DYNLINK_OUT=
|
||||
LINK = tlib /P256
|
||||
# Use objs in RTL build tree
|
||||
DYN_LINK = ilink32 -L$(BCB)\..\lib
|
||||
OBJEXT=obj
|
||||
DYNEXT=dll
|
||||
STEXT=lib
|
||||
# We use 4NT, which does not know about /Q
|
||||
#RM=-rd /S /Q
|
||||
RM=-rd /S
|
||||
PATH_SEP=\\
|
||||
MKDIR=-md /S
|
||||
STATIC_SUFFIX=st
|
||||
INSTALL_STEP=install_bc
|
||||
|
||||
all : platform all_dynamic all_static
|
||||
|
||||
!include common_macros_windows.mak
|
||||
|
||||
#RM=-rd /S /Q
|
||||
RM=-rd /S
|
||||
MKDIR=-md /S
|
||||
|
||||
DYNAMIC_DEFS=_RTLDLL;_WIN32;_DLL;_STLP_DESIGNATED_DLL
|
||||
STATIC_DEFS=_LIB;_WIN32;_STLP_NO_FORCE_INSTANTIATE
|
||||
|
||||
LINKSTARTUP= c0d32.obj
|
||||
|
||||
FLAGS_COMMON= -I.;..\stlport;$(BCB)\include;$(BCB)\include\windows -jb -j1 -w -c -w-par -w-inl -tWM -w-stl
|
||||
FLAGS_COMMON_static = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(STATIC_DEFS)
|
||||
FLAGS_COMMON_dynamic = $(FLAGS_COMMON) -D$(SYSDEFINES);$(USERDEFINES);$(DYNAMIC_DEFS) -tWDR
|
||||
|
||||
# -L$(MAKEDIR)\..\lib removed ...it should get ilink32.cfg values instead
|
||||
LDFLAGS_COMMON=-Gn -Gi -Tpd -aa -x
|
||||
LDFLAGS_COMMON_static= $(LDFLAGS_COMMON)
|
||||
LDFLAGS_COMMON_dynamic= $(LDFLAGS_COMMON)
|
||||
|
||||
|
||||
LDFLAGS_RELEASE_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_static= $(LDFLAGS_COMMON_static) $(LINKSTARTUP)
|
||||
|
||||
LDFLAGS_RELEASE_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_DEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
LDFLAGS_STLDEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) $(LINKSTARTUP)
|
||||
|
||||
LDLIBS_RELEASE_dynamic= import32.lib cw32mti.lib
|
||||
LDLIBS_DEBUG_dynamic= import32.lib cw32mti.lib
|
||||
LDLIBS_STLDEBUG_dynamic= import32.lib cw32mti.lib
|
||||
|
||||
|
||||
CXXFLAGS_RELEASE_static= $(FLAGS_COMMON_static) -O2 -n$(RELEASE_OBJDIR_static)
|
||||
CXXFLAGS_DEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(DEBUG_OBJDIR_static)
|
||||
CXXFLAGS_STLDEBUG_static= $(FLAGS_COMMON_static) -v -N -x -xp -n$(STLDEBUG_OBJDIR_static) -D_STLP_DEBUG
|
||||
|
||||
CXXFLAGS_RELEASE_dynamic= $(FLAGS_COMMON_dynamic) -O2 -n$(RELEASE_OBJDIR_dynamic)
|
||||
CXXFLAGS_DEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(DEBUG_OBJDIR_dynamic)
|
||||
CXXFLAGS_STLDEBUG_dynamic= $(FLAGS_COMMON_dynamic) -v -N -x -xp -n$(STLDEBUG_OBJDIR_dynamic) -D_STLP_DEBUG
|
||||
|
||||
RELEASE_LINK_COMMANDS_static=\
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(RELEASE_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
|
||||
DEBUG_LINK_COMMANDS_static= \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(DEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
STLDEBUG_LINK_COMMANDS_static= \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
+$(STLDEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
#
|
||||
# Target directories
|
||||
#
|
||||
#
|
||||
|
||||
$(RELEASE_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_dynamic)
|
||||
$(DEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_dynamic)
|
||||
$(STLDEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_dynamic)
|
||||
$(RELEASE_OBJDIR_static) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_static)
|
||||
$(DEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_static)
|
||||
$(STLDEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_static)
|
||||
|
||||
###### Targets ##################
|
||||
|
||||
all_static : $(ALL_STATIC_LIBS)
|
||||
|
||||
all_dynamic : $(ALL_DYNAMIC_LIBS)
|
||||
|
||||
install : $(INSTALL_STEP)
|
||||
|
||||
clean : $(CLEAN_SPECIFIC)
|
||||
-$(RM) $(RELEASE_OBJDIR_static) $(DEBUG_OBJDIR_static) \
|
||||
$(STLDEBUG_OBJDIR_static) $(RELEASE_OBJDIR_dynamic) \
|
||||
$(DEBUG_OBJDIR_dynamic) $(STLDEBUG_OBJDIR_dynamic)
|
||||
|
||||
clobber : clean
|
||||
-$(RM) $(OUTDIR)$(PATH_SEP)$(DEBUG_NAME).* \
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_NAME).* $(OUTDIR)$(PATH_SEP)$(STLDEBUG_NAME).*
|
||||
|
||||
#create a compiler platform directory
|
||||
platform:
|
||||
-$(MKDIR) $(OBJDIR_COMMON)
|
||||
-$(MKDIR) $(OBJDIR)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) : $(RELEASE_OBJDIR_dynamic) $(DEF_FILE) $(RELEASE_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_RELEASE_dynamic) $(RELEASE_OBJECTS_dynamic) , $(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB),,$(LDLIBS_RELEASE_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) : $(DEBUG_OBJDIR_dynamic) $(DEF_FILE) $(DEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_DEBUG_dynamic) $(DEBUG_OBJECTS_dynamic), $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) ,, $(LDLIBS_DEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) : $(STLDEBUG_OBJDIR_dynamic) $(DEF_FILE) $(STLDEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(LDFLAGS_STLDEBUG_dynamic) $(STLDEBUG_OBJECTS_dynamic) , $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) ,, $(LDLIBS_STLDEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) : $(RELEASE_OBJDIR_static) $(DEF_FILE) $(RELEASE_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) $(RELEASE_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) : $(DEBUG_OBJDIR_static) $(DEF_FILE) $(DEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) $(DEBUG_LINK_COMMANDS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) : $(STLDEBUG_OBJDIR_static) $(DEF_FILE) $(STLDEBUG_OBJECTS_static)
|
||||
$(LINK) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) $(STLDEBUG_LINK_COMMANDS_static)
|
||||
|
||||
#########################################
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
!include nmake_common.mak
|
||||
|
||||
.cpp.i:
|
||||
$(CPP) $(CXXFLAGS_DEBUG_dynamic) -n. -Sr -Ss -Sd {$< }
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
87
STLPORT/src/beos-setup
Normal file
87
STLPORT/src/beos-setup
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/bin/sh
|
||||
|
||||
function intel_setup
|
||||
{
|
||||
files='alloca assert ctype dirent err fcntl float new inttypes libio limits locale malloc math memory signal stdarg stddef stdio stdlib string time va_list wchar wctype'
|
||||
|
||||
for file in $files; do
|
||||
echo '#include_next "'"$file"'.h"' > "../stlport/beos/$file"'.h'
|
||||
echo '#include_next "'"c$file"'"' > "../stlport/beos/c$file"''
|
||||
done
|
||||
|
||||
files='fstream new exception typeinfo iomanip iosfwd iostream istream ostream stdexcept stdiostream stream streambuf strstream'
|
||||
|
||||
for file in $files; do
|
||||
echo '#include_next "'"$file"'.h"' > "../stlport/beos/$file"'.h'
|
||||
echo '#include_next "'"$file"'"' > "../stlport/beos/$file"''
|
||||
done
|
||||
}
|
||||
|
||||
function intel_uninstall
|
||||
{
|
||||
rm -fr ~/config/include/stlport
|
||||
cd ../lib
|
||||
for file in libstlport_gcc*; do
|
||||
rm -f ~/config/lib/$file
|
||||
done
|
||||
rm -f ~/config/lib/libstlport_gcc*.so
|
||||
}
|
||||
|
||||
function intel_install
|
||||
{
|
||||
cp -R ../stlport ~/config/include
|
||||
|
||||
cd ../lib
|
||||
for file in libstlport_gcc*.so.*; do
|
||||
basename=`echo $file | sed 's/\(.*\.so\).*/\1/'`
|
||||
cp $file ~/config/lib
|
||||
if test "$file" != "$basename"; then
|
||||
ln -s ~/config/lib/$file ~/config/lib/$basename
|
||||
fi
|
||||
done
|
||||
|
||||
for file in libstlport_gcc*.a; do
|
||||
cp $file ~/config/lib
|
||||
done
|
||||
|
||||
echo include files are in ~/config/include
|
||||
echo libraries are in ~/config/lib
|
||||
}
|
||||
|
||||
|
||||
if test $# -ne 1; then
|
||||
echo usage:
|
||||
echo " beos-setup -setup # sets up headers"
|
||||
echo " beos-setup -install # installs STLPort"
|
||||
echo " beos-setup -uninstall #uninstalls STLPort"
|
||||
|
||||
else
|
||||
|
||||
if test $1 = "-setup"; then
|
||||
intel_setup
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test $1 = "-uninstall"; then
|
||||
intel_uninstall
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test $1 = "-install"; then
|
||||
intel_install
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo unknown option $*
|
||||
exit 1
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
16
STLPORT/src/build-tempinc-xlc.mk
Normal file
16
STLPORT/src/build-tempinc-xlc.mk
Normal file
@@ -0,0 +1,16 @@
|
||||
tempIncConst = tempinc
|
||||
buildDir = .
|
||||
tempIncDir = $(buildDir)/$(tempIncConst)
|
||||
|
||||
TempInc_CFiles := $(wildcard $(tempIncDir)/*.C)
|
||||
TempInc_OFiles := $(patsubst %.C,%.o, $(TempInc_CFiles))
|
||||
|
||||
all.PHONY : $(TempInc_OFiles)
|
||||
|
||||
%.o : %.C
|
||||
@echo "Compiling File $@"
|
||||
@xlC_r \
|
||||
-I/tools/STLport-4.0/stlport -qmaxerr=10 -qtempinc=$(tempIncDir)
|
||||
-qrtti=all -qsrcmsg \
|
||||
-o $(@) \
|
||||
-c $<
|
||||
18
STLPORT/src/build-tempinc-xlc.sh
Normal file
18
STLPORT/src/build-tempinc-xlc.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
GNUMake=gmake
|
||||
MakeFile=build-tempinc-xlc.mk
|
||||
|
||||
PassNumber=0
|
||||
echo "Building the AIX tempinc directory."
|
||||
echo "Calling $MakeFile."
|
||||
until { $GNUMake -f $MakeFile -q ; }
|
||||
do
|
||||
let PassNumber=$PassNumber+1
|
||||
echo "Pass Number: $PassNumber"
|
||||
if { ! $GNUMake -f $MakeFile ; } then
|
||||
echo "An error occurred.. aborting"
|
||||
exit 1;
|
||||
fi
|
||||
done
|
||||
echo "Finished the AIX tempinc directory."
|
||||
37
STLPORT/src/c_locale.c
Normal file
37
STLPORT/src/c_locale.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
# include <stdlib.h>
|
||||
|
||||
# ifdef _STLP_REAL_LOCALE_IMPLEMENTED
|
||||
# include <limits.h>
|
||||
# include "c_locale.h"
|
||||
# if defined (WIN32) || defined (_WIN32)
|
||||
# include "c_locale_win32/c_locale_win32.c"
|
||||
# elif defined (_STLP_USE_GLIBC) && ! defined (__CYGWIN__)
|
||||
# if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
||||
# include "c_locale_glibc/c_locale_glibc2.c"
|
||||
# else
|
||||
# include "c_locale_glibc/c_locale_glibc.c"
|
||||
# endif
|
||||
# elif defined __ISCPP__
|
||||
# include "c_locale_is/c_locale_is.cpp"
|
||||
# endif
|
||||
# endif
|
||||
407
STLPORT/src/c_locale.h
Normal file
407
STLPORT/src/c_locale.h
Normal file
@@ -0,0 +1,407 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* It is impossible to write the C++ locale library in terms of locales
|
||||
* as defined in the C standard. Instead, we write the C++ locale and I/O
|
||||
* library in terms of a low level C-like interface. This file defines
|
||||
* that interface.
|
||||
*
|
||||
* The low-level locale interface can't be written portably; there
|
||||
* must be a version of it for each platform that the C++ library
|
||||
* is ported to. On many systems this interface may be a thin wrapper
|
||||
* for existing functionality.
|
||||
*/
|
||||
|
||||
#ifndef _STLP_C_LOCALE_IMPL_H
|
||||
# define _STLP_C_LOCALE_IMPL_H
|
||||
|
||||
# include <stl/c_locale.h>
|
||||
// # include <wchar.h>
|
||||
# include <stl/_cwchar.h>
|
||||
|
||||
#define _Locale_MAX_SIMPLE_NAME 256
|
||||
|
||||
/*
|
||||
* A number: the maximum length of a simple locale name.
|
||||
* (i.e. a name like like en_US, as opposed to a name like
|
||||
* en_US/de_AT/de_AT/es_MX/en_US/en_US) */
|
||||
#define _Locale_MAX_COMPOSITE_NAME 6*(_Locale_MAX_SIMPLE_NAME+3)
|
||||
|
||||
/*
|
||||
* Maximum length of a composite locale.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Typedefs:
|
||||
*/
|
||||
|
||||
#if defined (__GNUC__) || defined (_KCC) || defined(__ICC)
|
||||
typedef unsigned short int _Locale_mask_t;
|
||||
#else
|
||||
typedef unsigned int _Locale_mask_t;
|
||||
#endif
|
||||
|
||||
void * _Locale_ctype_create(const char *);
|
||||
void * _Locale_numeric_create(const char *);
|
||||
void * _Locale_time_create(const char *);
|
||||
void * _Locale_collate_create(const char *);
|
||||
void * _Locale_monetary_create(const char *);
|
||||
void * _Locale_messages_create(const char *);
|
||||
|
||||
/*
|
||||
* The char* argument is a simple locale name.
|
||||
* These functions return NULL to indicate failure.
|
||||
* The char* argument is a simple locale name, which may not
|
||||
* be "". These functions return NULL to indicate failure.
|
||||
*/
|
||||
|
||||
const char * _Locale_ctype_default(char * __buf);
|
||||
const char * _Locale_numeric_default(char * __buf);
|
||||
const char * _Locale_time_default(char * __buf);
|
||||
const char * _Locale_collate_default(char * __buf);
|
||||
const char * _Locale_monetary_default(char * __buf);
|
||||
const char * _Locale_messages_default(char * __buf);
|
||||
|
||||
/*
|
||||
* Returns the name of the user's default locale in each
|
||||
* category, as a null-terminated string. A NULL value
|
||||
* means the default "C" locale.
|
||||
*/
|
||||
|
||||
char * _Locale_ctype_name(const void *, char *);
|
||||
char * _Locale_numeric_name(const void *, char *);
|
||||
char * _Locale_time_name(const void *, char *);
|
||||
char * _Locale_collate_name(const void *, char *);
|
||||
char * _Locale_monetary_name(const void *, char *);
|
||||
char * _Locale_messages_name(const void *, char *);
|
||||
|
||||
/*
|
||||
* __buf points to a buffer that can hold at least _Locale_MAX_SIMPLE_NAME
|
||||
* characters. These functions store the name, as a null-terminated
|
||||
* string, in __buf.
|
||||
*/
|
||||
|
||||
void _Locale_ctype_destroy(void *);
|
||||
void _Locale_numeric_destroy(void *);
|
||||
void _Locale_time_destroy(void *);
|
||||
void _Locale_collate_destroy(void *);
|
||||
void _Locale_monetary_destroy(void *);
|
||||
void _Locale_messages_destroy(void *);
|
||||
|
||||
char * _Locale_extract_ctype_name(const char *cname, char *__buf);
|
||||
char * _Locale_extract_numeric_name(const char *cname, char *__buf);
|
||||
char * _Locale_extract_time_name(const char *cname, char *__buf);
|
||||
char * _Locale_extract_collate_name(const char *cname, char *__buf);
|
||||
char * _Locale_extract_monetary_name(const char *cname, char *__buf);
|
||||
char * _Locale_extract_messages_name(const char *cname, char *__buf);
|
||||
|
||||
/*
|
||||
* cname is a (possibly composite) locale name---i.e. a name that can
|
||||
* be passed to setlocale. _buf points to an array large enough to
|
||||
* store at least _Locale_MAX_SIMPLE_NAME characters, and each of these
|
||||
* functions extracts the name of a single category, stores it in buf
|
||||
* as a null-terminated string, and returns buf.
|
||||
*/
|
||||
|
||||
char * _Locale_compose_name(char *__buf,
|
||||
const char *__Ctype, const char *__Numeric,
|
||||
const char *__Time, const char *__Collate,
|
||||
const char *__Monetary, const char *__Messages,
|
||||
const char *__DefaultName);
|
||||
|
||||
/*
|
||||
* The inputs to this function are six null-terminated strings: the
|
||||
* names of a locale's six categories. Locale names for non-standard
|
||||
* categories are taken from __DefaultName.
|
||||
* __buf is a pointer to an array large enough to store at least
|
||||
* _Locale_MAX_COMPOSITE_NAME characters.
|
||||
* This function constructs a (possibly composite) name describing the
|
||||
* locale as a whole, stores that name in buf as a null-terminated
|
||||
* string, and returns buf.
|
||||
*/
|
||||
|
||||
/*
|
||||
* FUNCTIONS THAT USE CTYPE
|
||||
*/
|
||||
|
||||
/*
|
||||
* Narrow character functions:
|
||||
*/
|
||||
|
||||
const _Locale_mask_t * _Locale_ctype_table(struct _Locale_ctype *);
|
||||
|
||||
/*
|
||||
* Returns a pointer to the beginning of the ctype table. The table is
|
||||
* at least 257 bytes long; if p is the pointer returned by this
|
||||
* function, then p[c] is valid if c is EOF or if p is any value of
|
||||
* type unsigned char.
|
||||
*/
|
||||
|
||||
int _Locale_toupper(struct _Locale_ctype *, int);
|
||||
int _Locale_tolower(struct _Locale_ctype *, int);
|
||||
|
||||
/*
|
||||
* c is either EOF, or an unsigned char value.
|
||||
*/
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
/*
|
||||
* Wide character functions:
|
||||
*/
|
||||
_Locale_mask_t _Locale_wchar_ctype(struct _Locale_ctype *, wint_t,
|
||||
_Locale_mask_t);
|
||||
wint_t _Locale_wchar_tolower(struct _Locale_ctype *, wint_t);
|
||||
wint_t _Locale_wchar_toupper(struct _Locale_ctype *, wint_t);
|
||||
# endif
|
||||
|
||||
# if !defined ( _STLP_NO_MBSTATE_T )
|
||||
|
||||
/*
|
||||
* Multibyte functions:
|
||||
*/
|
||||
|
||||
int _Locale_mb_cur_max (struct _Locale_ctype *);
|
||||
/*
|
||||
* Returns the number of bytes of the longest allowed multibyte
|
||||
* character in the current encoding.
|
||||
*/
|
||||
|
||||
int _Locale_mb_cur_min (struct _Locale_ctype *);
|
||||
/*
|
||||
* Returns the number of bytes of the shortest allowed multibyte
|
||||
* character in the current encoding.
|
||||
*/
|
||||
|
||||
int _Locale_is_stateless (struct _Locale_ctype *);
|
||||
/*
|
||||
* Returns 1 if the current multibyte encoding is stateless
|
||||
* and does not require the use of an mbstate_t value.
|
||||
*/
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wint_t _Locale_btowc(struct _Locale_ctype *, int);
|
||||
int _Locale_wctob(struct _Locale_ctype *, wint_t);
|
||||
|
||||
/*
|
||||
* Just like btowc and wctob, from 4.6.5.1 of the C standard, Normative
|
||||
* Addendum 1. (And just like widen/narrow, from clause 22 of the C++
|
||||
* standard.)
|
||||
*/
|
||||
|
||||
size_t _Locale_mbtowc(struct _Locale_ctype *,
|
||||
wchar_t *,
|
||||
const char *, size_t,
|
||||
mbstate_t *);
|
||||
|
||||
/*
|
||||
* Almost identical to mbrtowc, from 4.6.5.3.2 of NA1. The only
|
||||
* important difference is that mbrtowc treats null wide characters
|
||||
* as special, and we don't. Specifically: examines the characters
|
||||
* in [from, from + n), extracts a single wide character, and stores
|
||||
* it in *to. Modifies shift_state if appropriate. The return value,
|
||||
* which is always positive, is the number of characters extracted from
|
||||
* the input sequence. Return value is (size_t) -1 if there was an
|
||||
* encoding error in the input sequence, and (size_t) -2 if
|
||||
* [from, from + n) is correct but not complete. None of the pointer
|
||||
* arguments may be null pointers.
|
||||
*/
|
||||
|
||||
size_t _Locale_wctomb(struct _Locale_ctype *,
|
||||
char *, size_t,
|
||||
const wchar_t,
|
||||
mbstate_t *);
|
||||
|
||||
/*
|
||||
* Again, very similar to wcrtomb. The differences are that (1) it
|
||||
* doesn't treat null characters as special; and (2) it stores at most
|
||||
* n characters. Converts c to a multibyte sequence, stores that
|
||||
* sequence in the array 'to', and returns the length of the sequence.
|
||||
* Modifies shift_state if appropriate. The return value is (size_t) -1
|
||||
* if c is not a valid wide character, and (size_t) -2 if the length of
|
||||
* the multibyte character sequence is greater than n.
|
||||
*/
|
||||
# endif
|
||||
|
||||
size_t _Locale_unshift(struct _Locale_ctype *,
|
||||
mbstate_t *,
|
||||
char *, size_t, char **);
|
||||
|
||||
/*
|
||||
* Inserts whatever characters are necessary to restore st to an
|
||||
* initial shift state. Sets *next to buf + m, where m is the number
|
||||
* of characters inserted. (0 <= m <= n.) Returns m to indicate
|
||||
* success, (size_t) -1 to indicate error, (size_t) -2 to indicate
|
||||
* partial success (more than n characters needed). For success or partial
|
||||
* success, sets *next to buf + m.
|
||||
*/
|
||||
|
||||
# endif /* _STLP_NO_MBSTATE_T */
|
||||
|
||||
/*
|
||||
* FUNCTIONS THAT USE COLLATE
|
||||
*/
|
||||
|
||||
int _Locale_strcmp(struct _Locale_collate *,
|
||||
const char *, size_t,
|
||||
const char *, size_t);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
int _Locale_strwcmp(struct _Locale_collate *,
|
||||
const wchar_t *, size_t,
|
||||
const wchar_t *, size_t);
|
||||
# endif
|
||||
/*
|
||||
* Compares the two sequences [s1, s1 + n1) and [s2, s2 + n2). Neither
|
||||
* sequence is assumed to be null-terminated, and null characters
|
||||
* aren't special. If the two sequences are the same up through
|
||||
* min(n1, n2), then the sequence that compares less is whichever one
|
||||
* is shorter.
|
||||
*/
|
||||
|
||||
size_t _Locale_strxfrm(struct _Locale_collate *,
|
||||
char *, size_t,
|
||||
const char *, size_t);
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
size_t _Locale_strwxfrm(struct _Locale_collate *,
|
||||
wchar_t *, size_t,
|
||||
const wchar_t *, size_t);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Creates a transformed version of the string [s2, s2 + n2). The
|
||||
* string may contain embedded null characters; nulls aren't special.
|
||||
* The transformed string begins at s1, and contains at most n1
|
||||
* characters. The return value is the length of the transformed
|
||||
* string. If the return value is greater than n1 then this is an
|
||||
* error condition: it indicates that there wasn't enough space. In
|
||||
* that case, the contents of [s1, s1 + n1) is unspecified.
|
||||
*/
|
||||
|
||||
/*
|
||||
* FUNCTIONS THAT USE NUMERIC
|
||||
*/
|
||||
|
||||
char _Locale_decimal_point(struct _Locale_numeric *);
|
||||
char _Locale_thousands_sep(struct _Locale_numeric *);
|
||||
const char * _Locale_grouping(struct _Locale_numeric *);
|
||||
|
||||
/*
|
||||
* Equivalent to the first three fields in struct lconv. (C standard,
|
||||
* section 7.4.)
|
||||
*/
|
||||
|
||||
const char * _Locale_true(struct _Locale_numeric *);
|
||||
const char * _Locale_false(struct _Locale_numeric *);
|
||||
|
||||
/*
|
||||
* Return "true" and "false" in English locales, and something
|
||||
* appropriate in non-English locales.
|
||||
*/
|
||||
|
||||
/*
|
||||
* FUNCTIONS THAT USE MONETARY
|
||||
*/
|
||||
|
||||
const char * _Locale_int_curr_symbol(struct _Locale_monetary *);
|
||||
const char * _Locale_currency_symbol(struct _Locale_monetary *);
|
||||
char _Locale_mon_decimal_point(struct _Locale_monetary *);
|
||||
char _Locale_mon_thousands_sep(struct _Locale_monetary *);
|
||||
const char * _Locale_mon_grouping(struct _Locale_monetary *);
|
||||
const char * _Locale_positive_sign(struct _Locale_monetary *);
|
||||
const char * _Locale_negative_sign(struct _Locale_monetary *);
|
||||
char _Locale_int_frac_digits(struct _Locale_monetary *);
|
||||
char _Locale_frac_digits(struct _Locale_monetary *);
|
||||
int _Locale_p_cs_precedes(struct _Locale_monetary *);
|
||||
int _Locale_p_sep_by_space(struct _Locale_monetary *);
|
||||
int _Locale_p_sign_posn(struct _Locale_monetary *);
|
||||
int _Locale_n_cs_precedes(struct _Locale_monetary *);
|
||||
int _Locale_n_sep_by_space(struct _Locale_monetary *);
|
||||
int _Locale_n_sign_posn(struct _Locale_monetary *);
|
||||
|
||||
/*
|
||||
* Return the obvious fields of struct lconv.
|
||||
*/
|
||||
|
||||
/*
|
||||
* FUNCTIONS THAT USE TIME
|
||||
*/
|
||||
|
||||
const char * _Locale_full_monthname(struct _Locale_time *, int);
|
||||
const char * _Locale_abbrev_monthname(struct _Locale_time *, int);
|
||||
|
||||
/*
|
||||
* month is in the range [0, 12).
|
||||
*/
|
||||
|
||||
const char * _Locale_full_dayofweek(struct _Locale_time *, int);
|
||||
const char * _Locale_abbrev_dayofweek(struct _Locale_time *, int);
|
||||
|
||||
/*
|
||||
* day is in the range [0, 7). Sunday is 0.
|
||||
*/
|
||||
|
||||
const char * _Locale_d_t_fmt(struct _Locale_time *);
|
||||
const char * _Locale_d_fmt(struct _Locale_time *);
|
||||
const char * _Locale_t_fmt(struct _Locale_time *);
|
||||
const char * _Locale_long_d_t_fmt(struct _Locale_time*);
|
||||
const char * _Locale_long_d_fmt(struct _Locale_time*);
|
||||
|
||||
const char * _Locale_am_str(struct _Locale_time *);
|
||||
const char * _Locale_pm_str(struct _Locale_time *);
|
||||
const char * _Locale_t_fmt_ampm(struct _Locale_time *);
|
||||
|
||||
|
||||
/*
|
||||
* FUNCTIONS THAT USE MESSAGES
|
||||
*/
|
||||
|
||||
int _Locale_catopen(struct _Locale_messages*, const char*);
|
||||
|
||||
/*
|
||||
* Very similar to catopen, except that it uses L to determine
|
||||
* which catalog to open.
|
||||
*/
|
||||
|
||||
void _Locale_catclose(struct _Locale_messages*, int);
|
||||
|
||||
/*
|
||||
* catalog is a value that was returned by a previous call to
|
||||
* _Locale_catopen
|
||||
*/
|
||||
|
||||
const char * _Locale_catgets(struct _Locale_messages *, int,
|
||||
int, int,const char *);
|
||||
|
||||
/*
|
||||
* Returns a string, identified by a set index and a message index,
|
||||
* from an opened message catalog. Returns default if no such
|
||||
* string exists.
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
_STLP_END_NAMESPACE
|
||||
# endif
|
||||
|
||||
# endif /* _STLP_C_LOCALE_IMPL_H */
|
||||
774
STLPORT/src/c_locale_glibc/c_locale_glibc.c
Normal file
774
STLPORT/src/c_locale_glibc/c_locale_glibc.c
Normal file
@@ -0,0 +1,774 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#ifdef _POSIX_MAPPED_FILES
|
||||
# include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include <stl/c_locale.h>
|
||||
#include <limits.h>
|
||||
#include <wctype.h>
|
||||
/* #include <libc-lock.h> */
|
||||
|
||||
#include <locale.h>
|
||||
#include <argz.h>
|
||||
#include "gcc_localeinfo.h"
|
||||
|
||||
wint_t btowc(int c);
|
||||
int wctob (wint_t c);
|
||||
|
||||
size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
|
||||
size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
|
||||
size_t mbrlen (const char* s, size_t n, mbstate_t *ps);
|
||||
|
||||
#include <nl_types.h>
|
||||
|
||||
|
||||
typedef struct _Locale_ctype {
|
||||
const struct locale_data* gcc_data;
|
||||
const int* __tolower;
|
||||
const int* __toupper;
|
||||
_Locale_mask_t* __class;
|
||||
} L_ctype_t;
|
||||
|
||||
typedef struct _Locale_numeric {
|
||||
const struct locale_data* gcc_data;
|
||||
} L_numeric_t;
|
||||
|
||||
typedef struct _Locale_time {
|
||||
const struct locale_data* gcc_data;
|
||||
} L_time_t;
|
||||
|
||||
typedef struct _Locale_collate {
|
||||
const struct locale_data* gcc_data;
|
||||
} L_collate_t;
|
||||
|
||||
typedef struct _Locale_monetary {
|
||||
const struct locale_data* gcc_data;
|
||||
} L_monetary_t;
|
||||
|
||||
typedef struct _Locale_messages {
|
||||
const struct locale_data* gcc_data;
|
||||
} L_messages_t;
|
||||
|
||||
static char *
|
||||
_Locale_extract_name ( const char *cname, char *into, int category )
|
||||
{
|
||||
int i = 0;
|
||||
const char * end;
|
||||
|
||||
if ( cname[0] != '/' )
|
||||
return strcpy(into, cname); /* simple locale name */
|
||||
|
||||
for ( i = 0; i <= category; i ++ ) {
|
||||
while ( *cname != '\0' && *cname != '/' )
|
||||
cname++;
|
||||
if ( *cname == '\0' )
|
||||
return into;
|
||||
cname++;
|
||||
}
|
||||
|
||||
if ( *cname == '\0' )
|
||||
return into;
|
||||
|
||||
end = cname;
|
||||
while ( *end != '\0' && *end != '/' )
|
||||
end++;
|
||||
|
||||
strncpy ( into, cname, end - cname );
|
||||
into [ end - cname ] = '\0';
|
||||
|
||||
return into;
|
||||
}
|
||||
|
||||
char* _Locale_name(const struct locale_data* gcc_data,
|
||||
char* buf)
|
||||
{
|
||||
if (!(gcc_data && gcc_data->name)) return 0;
|
||||
strncpy(buf, gcc_data->name, _Locale_MAX_SIMPLE_NAME);
|
||||
buf [ _Locale_MAX_SIMPLE_NAME - 1 ] = '\0';
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
/* calls _nl_find_locale which is a function internal to the glibc
|
||||
locale implementation that loads locale data in from the data
|
||||
files. The locale_data struct has information for all categories.
|
||||
In the following implementation we use a locale_data struct for
|
||||
each category for simplicity, though there is an obvious waste in
|
||||
doing that. */
|
||||
const struct locale_data *
|
||||
_Find_locale (char *locale_path, size_t locale_path_len,
|
||||
int category, char **name)
|
||||
{
|
||||
return __nl_find_locale(locale_path, locale_path_len, category, name);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_Remove_locale (int locale, struct locale_data *data)
|
||||
{
|
||||
/* this should eventually call _nl_remove_locale() in glibc 2.1 */
|
||||
}
|
||||
|
||||
/* couldn't find where LOCALE_PATH was defined in glibc,
|
||||
but this is the directory it is defined to -JGS */
|
||||
#define __LOCALE_PATH "/usr/share/locale"
|
||||
|
||||
const struct locale_data*
|
||||
_Category_create(const char * name, int category)
|
||||
{
|
||||
/* JGS, where should this path come from? */
|
||||
char* locpath_var;
|
||||
char* locale_path = NULL;
|
||||
size_t locale_path_len = 0;
|
||||
|
||||
locpath_var = __secure_getenv("LOCPATH");
|
||||
|
||||
if (locpath_var != NULL && locpath_var[0] != '\0')
|
||||
if (argz_create_sep (locpath_var, ':',
|
||||
&locale_path, &locale_path_len) != 0)
|
||||
return NULL;
|
||||
|
||||
if (argz_add_sep (&locale_path, &locale_path_len, __LOCALE_PATH, ':') != 0)
|
||||
return NULL;
|
||||
|
||||
return _Find_locale(locale_path, locale_path_len,
|
||||
category, (char**)&name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static const char* get_default_locale(char* buf) {
|
||||
char* lang = getenv("LANG");
|
||||
if (lang == NULL || lang[0] == '\0') {
|
||||
buf[0] = '\0';
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
strcpy(buf, lang);
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
|
||||
const char* _Locale_ctype_default(char* buf) {
|
||||
char fullname[_Locale_MAX_COMPOSITE_NAME];
|
||||
if (get_default_locale(fullname) == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return _Locale_extract_ctype_name(fullname, buf);
|
||||
}
|
||||
|
||||
const char* _Locale_numeric_default(char* buf) {
|
||||
char fullname[_Locale_MAX_COMPOSITE_NAME];
|
||||
if (get_default_locale(fullname) == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return _Locale_extract_numeric_name(fullname, buf);
|
||||
}
|
||||
|
||||
const char* _Locale_time_default(char* buf) {
|
||||
char fullname[_Locale_MAX_COMPOSITE_NAME];
|
||||
if (get_default_locale(fullname) == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return _Locale_extract_time_name(fullname, buf);
|
||||
}
|
||||
|
||||
const char* _Locale_collate_default(char* buf) {
|
||||
char fullname[_Locale_MAX_COMPOSITE_NAME];
|
||||
if (get_default_locale(fullname) == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return _Locale_extract_collate_name(fullname, buf);
|
||||
}
|
||||
|
||||
const char* _Locale_monetary_default(char* buf) {
|
||||
char fullname[_Locale_MAX_COMPOSITE_NAME];
|
||||
if (get_default_locale(fullname) == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return _Locale_extract_monetary_name(fullname, buf);
|
||||
}
|
||||
|
||||
const char* _Locale_messages_default(char* buf) {
|
||||
char fullname[_Locale_MAX_COMPOSITE_NAME];
|
||||
if (get_default_locale(fullname) == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return _Locale_extract_messages_name(fullname, buf);
|
||||
}
|
||||
|
||||
|
||||
/****** Numeric Category ******/
|
||||
|
||||
void*
|
||||
_Locale_numeric_create(const char * name) {
|
||||
L_numeric_t* lnum = (L_numeric_t*)malloc(sizeof(L_numeric_t));
|
||||
lnum->gcc_data = _Category_create(name, LC_NUMERIC);
|
||||
return (void*)lnum;
|
||||
}
|
||||
|
||||
|
||||
char* _Locale_numeric_name(const void* lnum,
|
||||
char* buf) {
|
||||
return _Locale_name(((struct _Locale_ctype*)lnum)->gcc_data, buf);
|
||||
}
|
||||
void _Locale_numeric_destroy(void* lnum)
|
||||
{
|
||||
_Remove_locale(LC_NUMERIC, (struct locale_data *)((struct _Locale_ctype*)lnum)->gcc_data);
|
||||
free(lnum);
|
||||
}
|
||||
char* _Locale_extract_numeric_name(const char* cname, char* buf)
|
||||
{
|
||||
return _Locale_extract_name(cname, buf, LC_NUMERIC);
|
||||
}
|
||||
char _Locale_decimal_point(struct _Locale_numeric* lnum)
|
||||
{
|
||||
return lnum->gcc_data->values[_NL_ITEM_INDEX(DECIMAL_POINT)].string[0];
|
||||
}
|
||||
char _Locale_thousands_sep(struct _Locale_numeric* lnum)
|
||||
{
|
||||
return lnum->gcc_data->values[_NL_ITEM_INDEX(THOUSANDS_SEP)].string[0];
|
||||
}
|
||||
const char* _Locale_grouping(struct _Locale_numeric * lnum)
|
||||
{
|
||||
return lnum->gcc_data->values[_NL_ITEM_INDEX(GROUPING)].string;
|
||||
}
|
||||
|
||||
/* JGS: gcc/linux does not provide true/false names in their
|
||||
* locale data files
|
||||
*/
|
||||
|
||||
static const char* __true_name = "true";
|
||||
static const char* __false_name = "false";
|
||||
|
||||
const char * _Locale_true(struct _Locale_numeric *l)
|
||||
{ return __true_name; }
|
||||
const char * _Locale_false(struct _Locale_numeric *l)
|
||||
{ return __false_name; }
|
||||
|
||||
|
||||
/****** Monetary Category ******/
|
||||
|
||||
void* _Locale_monetary_create(const char* name) {
|
||||
L_monetary_t* lmon = (L_monetary_t*)malloc(sizeof(L_monetary_t));
|
||||
lmon->gcc_data = _Category_create(name, LC_MONETARY);
|
||||
return lmon;
|
||||
}
|
||||
|
||||
char* _Locale_monetary_name(const void* lmon,
|
||||
char* buf) {
|
||||
return _Locale_name(((struct _Locale_monetary*)lmon)->gcc_data, buf);
|
||||
}
|
||||
|
||||
void _Locale_monetary_destroy(void*lmon) {
|
||||
_Remove_locale(LC_MONETARY, (struct locale_data *)((struct _Locale_monetary*)lmon)->gcc_data);
|
||||
free(lmon);
|
||||
}
|
||||
|
||||
char* _Locale_extract_monetary_name(const char* cname, char* buf) {
|
||||
return _Locale_extract_name(cname, buf, LC_MONETARY);
|
||||
}
|
||||
|
||||
const char* _Locale_int_curr_symbol(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(INT_CURR_SYMBOL)].string;
|
||||
}
|
||||
const char* _Locale_currency_symbol(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(CURRENCY_SYMBOL)].string;
|
||||
}
|
||||
char _Locale_mon_decimal_point(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(MON_DECIMAL_POINT)].string[0];
|
||||
}
|
||||
char _Locale_mon_thousands_sep(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(MON_THOUSANDS_SEP)].string[0];
|
||||
}
|
||||
const char* _Locale_mon_grouping(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(MON_GROUPING)].string;
|
||||
}
|
||||
const char* _Locale_positive_sign(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(POSITIVE_SIGN)].string;
|
||||
}
|
||||
const char* _Locale_negative_sign(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(NEGATIVE_SIGN)].string;
|
||||
}
|
||||
char _Locale_int_frac_digits(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(INT_FRAC_DIGITS)].string[0];
|
||||
}
|
||||
char _Locale_frac_digits(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(FRAC_DIGITS)].string[0];
|
||||
}
|
||||
int _Locale_p_cs_precedes(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(P_CS_PRECEDES)].word;
|
||||
}
|
||||
int _Locale_p_sep_by_space(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(P_SEP_BY_SPACE)].word;
|
||||
}
|
||||
int _Locale_p_sign_posn(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(P_SIGN_POSN)].word;
|
||||
}
|
||||
int _Locale_n_cs_precedes(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(N_CS_PRECEDES)].word;
|
||||
}
|
||||
int _Locale_n_sep_by_space(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(N_SEP_BY_SPACE)].word;
|
||||
}
|
||||
int _Locale_n_sign_posn(struct _Locale_monetary* lmon) {
|
||||
return lmon->gcc_data->values[_NL_ITEM_INDEX(N_SIGN_POSN)].word;
|
||||
}
|
||||
|
||||
/****** Time Category ******/
|
||||
|
||||
void* _Locale_time_create(const char * name) {
|
||||
L_time_t* ltime = (L_time_t*)malloc(sizeof(L_time_t));
|
||||
ltime->gcc_data = _Category_create(name, LC_TIME);
|
||||
return ltime;
|
||||
}
|
||||
|
||||
char* _Locale_time_name(const void* ltime,
|
||||
char* buf) {
|
||||
return _Locale_name(((struct _Locale_time*)ltime)->gcc_data, buf);
|
||||
}
|
||||
char* _Locale_extract_time_name(const char* cname, char* buf) {
|
||||
return _Locale_extract_name(cname, buf, LC_TIME);
|
||||
}
|
||||
void _Locale_time_destroy(void* ltime) {
|
||||
_Remove_locale(LC_TIME, (struct locale_data *)((struct _Locale_time*)ltime)->gcc_data);
|
||||
free(ltime);
|
||||
}
|
||||
const char * _Locale_full_monthname(struct _Locale_time *ltime, int month) {
|
||||
const char **names = (const char **)&(ltime->gcc_data->values[_NL_ITEM_INDEX(MON_1)]);
|
||||
return names[month];
|
||||
}
|
||||
const char * _Locale_abbrev_monthname(struct _Locale_time *ltime, int month) {
|
||||
const char **names = (const char **)&(ltime->gcc_data->values[_NL_ITEM_INDEX(ABMON_1)]);
|
||||
return names[month];
|
||||
}
|
||||
const char * _Locale_full_dayofweek(struct _Locale_time *ltime, int day) {
|
||||
const char **names = (const char **)&(ltime->gcc_data->values[_NL_ITEM_INDEX(DAY_1)]);
|
||||
return names[day];
|
||||
}
|
||||
const char * _Locale_abbrev_dayofweek(struct _Locale_time *ltime, int day) {
|
||||
const char **names = (const char **)&(ltime->gcc_data->values[_NL_ITEM_INDEX(ABDAY_1)]);
|
||||
return names[day];
|
||||
}
|
||||
const char* _Locale_d_t_fmt(struct _Locale_time* ltime) {
|
||||
return ltime->gcc_data->values[_NL_ITEM_INDEX(D_T_FMT)].string;
|
||||
}
|
||||
const char* _Locale_long_d_t_fmt(struct _Locale_time* ltime) {
|
||||
return ltime->gcc_data->values[_NL_ITEM_INDEX(D_T_FMT)].string;
|
||||
}
|
||||
const char* _Locale_d_fmt(struct _Locale_time* ltime)
|
||||
{
|
||||
return ltime->gcc_data->values[_NL_ITEM_INDEX(D_FMT)].string;
|
||||
}
|
||||
const char* _Locale_long_d_fmt(struct _Locale_time* ltime)
|
||||
{
|
||||
return ltime->gcc_data->values[_NL_ITEM_INDEX(D_FMT)].string;
|
||||
}
|
||||
const char* _Locale_t_fmt(struct _Locale_time* ltime) {
|
||||
return ltime->gcc_data->values[_NL_ITEM_INDEX(T_FMT)].string;
|
||||
}
|
||||
const char* _Locale_am_str(struct _Locale_time* ltime) {
|
||||
return ltime->gcc_data->values[_NL_ITEM_INDEX(AM_STR)].string;
|
||||
}
|
||||
const char* _Locale_pm_str(struct _Locale_time* ltime) {
|
||||
return ltime->gcc_data->values[_NL_ITEM_INDEX(PM_STR)].string;
|
||||
}
|
||||
const char* _Locale_t_fmt_ampm(struct _Locale_time* ltime)
|
||||
{
|
||||
return ltime->gcc_data->values[_NL_ITEM_INDEX(T_FMT_AMPM)].string;
|
||||
}
|
||||
|
||||
|
||||
/****** Messages Category ******/
|
||||
|
||||
void* _Locale_messages_create(const char * name) {
|
||||
L_messages_t* lmsg = (L_messages_t*)malloc(sizeof(L_messages_t));
|
||||
lmsg->gcc_data = _Category_create(name, LC_MESSAGES);
|
||||
return lmsg;
|
||||
}
|
||||
|
||||
char* _Locale_messages_name(const void* lmsg, char* buf) {
|
||||
return _Locale_name(((struct _Locale_messages*)lmsg)->gcc_data, buf);
|
||||
}
|
||||
|
||||
void _Locale_messages_destroy(void* lmsg) {
|
||||
_Remove_locale(LC_MESSAGES, (struct locale_data *)((struct _Locale_messages*)lmsg)->gcc_data);
|
||||
free(lmsg);
|
||||
}
|
||||
|
||||
char* _Locale_extract_messages_name(const char* cname, char* buf) {
|
||||
return _Locale_extract_name(cname, buf, LC_MESSAGES);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Could not find support for locale specific messages in glibc
|
||||
|
||||
Also, this C locale interface should use a typedef for the catalog
|
||||
instead of just an int. Currently I'm casting a void* (nl_catd)
|
||||
back and forth to and int.
|
||||
|
||||
-JGS
|
||||
*/
|
||||
|
||||
int _Locale_catopen(struct _Locale_messages*l, const char* cat_name) {
|
||||
return (int)catopen(cat_name, 0); /* JGS, don't know about the flag */
|
||||
}
|
||||
void _Locale_catclose(struct _Locale_messages*l, int catalog) {
|
||||
catclose((nl_catd)catalog);
|
||||
}
|
||||
const char* _Locale_catgets(struct _Locale_messages*l, int catalog,
|
||||
int set_num, int msg_num,
|
||||
const char *dfault){
|
||||
return catgets((nl_catd)catalog, set_num, msg_num, dfault);
|
||||
}
|
||||
|
||||
|
||||
/****** ctype Category ******/
|
||||
|
||||
|
||||
/*
|
||||
gcc uses a different set of masks for wide characters than for
|
||||
normal characters. However, the C++ standard requires there
|
||||
to be only one set of masks for both. Therefore we must
|
||||
translate the mask values from the wide characters to the
|
||||
mask values for the normal characters. -JGS
|
||||
*/
|
||||
static _Locale_mask_t _Map_wchar_mask_to_char_mask(wctype_t m) {
|
||||
_Locale_mask_t ret = 0;
|
||||
if (m & _ISwcntrl) ret |= _Locale_CNTRL;
|
||||
if (m & _ISwupper) ret |= _Locale_UPPER;
|
||||
if (m & _ISwlower) ret |= _Locale_LOWER;
|
||||
if (m & _ISwdigit) ret |= _Locale_DIGIT;
|
||||
if (m & _ISwxdigit) ret |= _Locale_XDIGIT;
|
||||
if (m & _ISwpunct) ret |= _Locale_PUNCT;
|
||||
if (m & _ISwspace) ret |= _Locale_SPACE;
|
||||
if (m & _ISwprint) ret |= _Locale_PRINT;
|
||||
if (m & _ISwalpha) ret |= _Locale_ALPHA;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void* _Locale_ctype_create(const char * name) {
|
||||
const union locale_data_value *ctypes;
|
||||
L_ctype_t* lctype;
|
||||
|
||||
lctype = (L_ctype_t*)malloc(sizeof(L_ctype_t));
|
||||
lctype->gcc_data = _Category_create(name, LC_CTYPE);
|
||||
ctypes = lctype->gcc_data->values;
|
||||
|
||||
lctype->__class = (_Locale_mask_t *)
|
||||
(ctypes[_NL_ITEM_INDEX (_NL_CTYPE_CLASS)] .string) + 128;
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
lctype->__tolower = (const int *)
|
||||
(ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER_EB)].string) + 128;
|
||||
lctype->__toupper = (const int *)
|
||||
(ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER_EB)].string) + 128;
|
||||
#elif BYTE_ORDER == LITTLE_ENDIAN
|
||||
lctype->__tolower = (const int *)
|
||||
(ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER_EL)].string) + 128;
|
||||
lctype->__toupper = (const int *)
|
||||
(ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER_EL)].string) + 128;
|
||||
#else
|
||||
#error bizarre byte order
|
||||
#endif
|
||||
return lctype;
|
||||
}
|
||||
char* _Locale_ctype_name(const void* lctype,
|
||||
char* buf) {
|
||||
return _Locale_name(((struct _Locale_ctype*)lctype)->gcc_data, buf);
|
||||
}
|
||||
void _Locale_ctype_destroy(void* lctype) {
|
||||
_Remove_locale(LC_CTYPE, (struct locale_data *)((struct _Locale_ctype*)lctype)->gcc_data);
|
||||
free(lctype);
|
||||
}
|
||||
char* _Locale_extract_ctype_name(const char* cname, char* buf) {
|
||||
return _Locale_extract_name(cname, buf, LC_CTYPE);
|
||||
}
|
||||
const _Locale_mask_t* _Locale_ctype_table(struct _Locale_ctype* lctype) {
|
||||
return lctype->__class;
|
||||
}
|
||||
int _Locale_toupper(struct _Locale_ctype* lctype, int c) {
|
||||
return lctype->__toupper[c];
|
||||
}
|
||||
int _Locale_tolower(struct _Locale_ctype* lctype, int c) {
|
||||
return lctype->__tolower[c];
|
||||
}
|
||||
|
||||
/* Wide Character Functions */
|
||||
|
||||
static inline size_t
|
||||
cname_lookup (wint_t wc, const struct locale_data* loc)
|
||||
{
|
||||
unsigned int *__nl_ctype_names;
|
||||
unsigned int hash_size, hash_layers;
|
||||
size_t result, cnt;
|
||||
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
__nl_ctype_names = (unsigned int*)loc->values[_NL_ITEM_INDEX(_NL_CTYPE_NAMES_EB)].string;
|
||||
#elif BYTE_ORDER == LITTLE_ENDIAN
|
||||
__nl_ctype_names = (unsigned int*)loc->values[_NL_ITEM_INDEX(_NL_CTYPE_NAMES_EL)].string;
|
||||
#else
|
||||
#error bizarre byte order
|
||||
#endif
|
||||
|
||||
hash_size = loc->values[_NL_ITEM_INDEX(_NL_CTYPE_HASH_SIZE)].word;
|
||||
hash_layers = loc->values[_NL_ITEM_INDEX(_NL_CTYPE_HASH_LAYERS)].word;
|
||||
|
||||
result = wc % hash_size;
|
||||
for (cnt = 0; cnt < hash_layers; ++cnt) {
|
||||
if (__nl_ctype_names[result] == wc)
|
||||
break;
|
||||
result += hash_size;
|
||||
}
|
||||
return cnt < hash_layers ? result : ~((size_t) 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
_Locale_mask_t _Locale_wchar_ctype(struct _Locale_ctype* loc, wint_t wc,
|
||||
_Locale_mask_t which_bits) {
|
||||
const struct locale_data* locale = loc->gcc_data;
|
||||
const unsigned int *class32_b;
|
||||
size_t idx;
|
||||
|
||||
idx = cname_lookup (wc, locale);
|
||||
if (idx == ~((size_t) 0))
|
||||
return 0;
|
||||
|
||||
class32_b = (u_int32_t *)
|
||||
locale->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS32)].string;
|
||||
|
||||
return _Map_wchar_mask_to_char_mask( class32_b[idx] ) & which_bits;
|
||||
}
|
||||
|
||||
|
||||
|
||||
wint_t
|
||||
__towctrans_ld (wint_t wc, wctrans_t desc, const struct locale_data* locale)
|
||||
{
|
||||
size_t idx;
|
||||
|
||||
idx = cname_lookup (wc, locale);
|
||||
if (idx == ~((size_t) 0))
|
||||
/* Character is not known. Default action is to simply return it. */
|
||||
return wc;
|
||||
|
||||
return (wint_t) desc[idx];
|
||||
}
|
||||
|
||||
wint_t _Locale_wchar_tolower(struct _Locale_ctype* locale, wint_t wc) {
|
||||
return __towctrans_ld (wc, (const unsigned int *)locale->__tolower, locale->gcc_data);
|
||||
}
|
||||
wint_t _Locale_wchar_toupper(struct _Locale_ctype* locale, wint_t wc) {
|
||||
return __towctrans_ld (wc, (const unsigned int *)locale->__toupper, locale->gcc_data);
|
||||
}
|
||||
|
||||
|
||||
int _Locale_mb_cur_max (struct _Locale_ctype *lctype) {
|
||||
return lctype->gcc_data->values[_NL_ITEM_INDEX(_NL_CTYPE_MB_CUR_MAX)].word;
|
||||
}
|
||||
|
||||
int _Locale_mb_cur_min (struct _Locale_ctype *l) {
|
||||
return 1; /* JGS just a guess */
|
||||
}
|
||||
|
||||
int _Locale_is_stateless (struct _Locale_ctype *l) { return 1; }
|
||||
|
||||
wint_t _Locale_btowc(struct _Locale_ctype *l, int c) {
|
||||
return btowc(c);
|
||||
}
|
||||
|
||||
/*
|
||||
glibc currently doesn't support locale dependent conversion,
|
||||
which affects the following functions. When it does, then
|
||||
these functions will need to change. Hopeully, the
|
||||
just the calls to the glibc functions will need to be
|
||||
replaced.
|
||||
-JGS
|
||||
*/
|
||||
|
||||
int _Locale_wctob(struct _Locale_ctype *l, wint_t c) {
|
||||
return wctob(c);
|
||||
}
|
||||
|
||||
size_t _Locale_mbtowc(struct _Locale_ctype *l,
|
||||
wchar_t *to,
|
||||
const char *from, size_t n,
|
||||
mbstate_t *shift_state)
|
||||
{
|
||||
int ret;
|
||||
if (to)
|
||||
ret = mbrtowc(to, from, n, shift_state);
|
||||
else
|
||||
ret = mbrlen(from, n, shift_state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t _Locale_wctomb(struct _Locale_ctype *l,
|
||||
char *to, size_t n,
|
||||
const wchar_t c,
|
||||
mbstate_t *shift_state)
|
||||
{
|
||||
char buf [MB_LEN_MAX];
|
||||
int ret;
|
||||
char* mb = buf;
|
||||
ret = wcrtomb(mb, c, shift_state);
|
||||
|
||||
if (ret > n)
|
||||
return (size_t)-2;
|
||||
else if (ret <= 0)
|
||||
return ret;
|
||||
|
||||
n = ret;
|
||||
while (n--)
|
||||
*to++ = *mb++;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t _Locale_unshift(struct _Locale_ctype *l,
|
||||
mbstate_t * st,
|
||||
char *buf, size_t n, char **next) {
|
||||
*next = buf; /* JGS stateless, so don't need to do anything? */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/****** Collate Category ******/
|
||||
|
||||
void* _Locale_collate_create(const char * name) {
|
||||
L_collate_t* lcollate = (L_collate_t*)malloc(sizeof(L_collate_t));
|
||||
lcollate->gcc_data = _Category_create(name, LC_COLLATE);
|
||||
return lcollate;
|
||||
}
|
||||
|
||||
char* _Locale_collate_name(const void* lcollate, char* buf) {
|
||||
return _Locale_name(((struct _Locale_collate*)lcollate)->gcc_data, buf);
|
||||
}
|
||||
|
||||
void _Locale_collate_destroy(void* lcollate) {
|
||||
_Remove_locale(LC_COLLATE, (struct locale_data *)((struct _Locale_collate*)lcollate)->gcc_data);
|
||||
free(lcollate);
|
||||
}
|
||||
|
||||
char* _Locale_extract_collate_name(const char* cname, char* buf) {
|
||||
return _Locale_extract_name(cname, buf, LC_COLLATE);
|
||||
}
|
||||
|
||||
/* copied from the IRIX version -JGS */
|
||||
char* _Locale_compose_name(char* buf,
|
||||
const char* ctype, const char* numeric,
|
||||
const char* time, const char* collate,
|
||||
const char* monetary, const char* messages,
|
||||
const char *default_name)
|
||||
{
|
||||
(void) default_name;
|
||||
|
||||
if ( !strcmp ( ctype, numeric ) &&
|
||||
!strcmp ( ctype, time ) &&
|
||||
!strcmp ( ctype, collate ) &&
|
||||
!strcmp ( ctype, monetary ) &&
|
||||
!strcmp ( ctype, messages ) )
|
||||
return strcpy ( buf, ctype );
|
||||
|
||||
strcpy ( buf, "/" );
|
||||
strcat ( buf, ctype );
|
||||
|
||||
strcat ( buf, "/" );
|
||||
strcat ( buf, numeric );
|
||||
|
||||
strcat ( buf, "/" );
|
||||
strcat ( buf, time );
|
||||
|
||||
strcat ( buf, "/" );
|
||||
strcat ( buf, collate );
|
||||
|
||||
strcat ( buf, "/" );
|
||||
strcat ( buf, monetary );
|
||||
|
||||
strcat ( buf, "/" );
|
||||
strcat ( buf, messages );
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
glibc doesn't have a locale specific strcmp
|
||||
This doesn't ignore null chars the way it should
|
||||
*/
|
||||
int
|
||||
_Locale_strcmp(struct _Locale_collate * l,
|
||||
const char *s1, size_t n1,
|
||||
const char *s2, size_t n2)
|
||||
{
|
||||
int ret;
|
||||
int minN = n1 < n2 ? n1 : n2;
|
||||
ret = strncmp(s1, s2, minN);
|
||||
if (ret == 0) {
|
||||
if (n1 < n2) return -1;
|
||||
else if (n1 > n2) return 1;
|
||||
else return 0;
|
||||
} else
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int _Locale_strwcmp(struct _Locale_collate*l,
|
||||
const wchar_t*s1, size_t n1,
|
||||
const wchar_t*s2, size_t n2)
|
||||
{
|
||||
int ret;
|
||||
int minN = n1 < n2 ? n1 : n2;
|
||||
ret = wcsncmp(s1, s2, minN);
|
||||
if (ret == 0) {
|
||||
if (n1 < n2) return -1;
|
||||
else if (n1 > n2) return 1;
|
||||
else return 0;
|
||||
} else
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
size_t _Locale_strxfrm(struct _Locale_collate* lcollate,
|
||||
char* dest, size_t destN, const char* src, size_t srcN)
|
||||
{
|
||||
size_t n;
|
||||
n = strxfrm(dest, src, destN);
|
||||
if (n > destN)
|
||||
return (size_t)-1;
|
||||
dest[n] = 0;
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t _Locale_strwxfrm(struct _Locale_collate* lcollate,
|
||||
wchar_t* dest, size_t destN,
|
||||
const wchar_t* src, size_t srcN)
|
||||
{
|
||||
size_t n;
|
||||
n = wcsxfrm(dest, src, destN);
|
||||
if (n > destN)
|
||||
return (size_t)-1;
|
||||
dest[n] = 0;
|
||||
return n;
|
||||
}
|
||||
207
STLPORT/src/c_locale_glibc/gcc_localeinfo.h
Normal file
207
STLPORT/src/c_locale_glibc/gcc_localeinfo.h
Normal file
@@ -0,0 +1,207 @@
|
||||
/* localeinfo.h -- declarations for internal libc locale interfaces
|
||||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _LOCALEINFO_H
|
||||
#define _LOCALEINFO_H 1
|
||||
|
||||
#include <stddef.h>
|
||||
#include <langinfo.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
/* stuff from loadinfo.h */
|
||||
|
||||
#ifndef PARAMS
|
||||
# if __STDC__
|
||||
# define PARAMS(args) args
|
||||
# else
|
||||
# define PARAMS(args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Encoding of locale name parts. */
|
||||
#define CEN_REVISION 1
|
||||
#define CEN_SPONSOR 2
|
||||
#define CEN_SPECIAL 4
|
||||
#define XPG_NORM_CODESET 8
|
||||
#define XPG_CODESET 16
|
||||
#define TERRITORY 32
|
||||
#define CEN_AUDIENCE 64
|
||||
#define XPG_MODIFIER 128
|
||||
|
||||
#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
|
||||
#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
|
||||
|
||||
|
||||
struct loaded_l10nfile
|
||||
{
|
||||
const char *filename;
|
||||
int decided;
|
||||
|
||||
const void *data;
|
||||
|
||||
struct loaded_l10nfile *next;
|
||||
struct loaded_l10nfile *successor[1];
|
||||
};
|
||||
|
||||
|
||||
extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
|
||||
size_t name_len));
|
||||
|
||||
extern struct loaded_l10nfile *
|
||||
_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
|
||||
const char *dirlist, size_t dirlist_len, int mask,
|
||||
const char *language, const char *territory,
|
||||
const char *codeset,
|
||||
const char *normalized_codeset,
|
||||
const char *modifier, const char *special,
|
||||
const char *sponsor, const char *revision,
|
||||
const char *filename, int do_allocate));
|
||||
|
||||
|
||||
extern const char *_nl_expand_alias PARAMS ((const char *name));
|
||||
|
||||
extern int _nl_explode_name PARAMS ((char *name, const char **language,
|
||||
const char **modifier,
|
||||
const char **territory,
|
||||
const char **codeset,
|
||||
const char **normalized_codeset,
|
||||
const char **special,
|
||||
const char **sponsor,
|
||||
const char **revision));
|
||||
|
||||
|
||||
|
||||
/* Magic number at the beginning of a locale data file for CATEGORY. */
|
||||
#define LIMAGIC(category) (0x960617de ^ (category))
|
||||
|
||||
/* Two special weight constants for the collation data. */
|
||||
#define FORWARD_CHAR ((wchar_t) 0xfffffffd)
|
||||
#define ELLIPSIS_CHAR ((wchar_t) 0xfffffffe)
|
||||
#define IGNORE_CHAR ((wchar_t) 0xffffffff)
|
||||
|
||||
#define MAX_USAGE_COUNT (UINT_MAX - 1)
|
||||
#define UNDELETABLE UINT_MAX
|
||||
|
||||
/* Structure describing locale data in core for a category. */
|
||||
struct locale_data
|
||||
{
|
||||
const char *name;
|
||||
const char *filedata; /* Region mapping the file data. */
|
||||
off_t filesize; /* Size of the file (and the region). */
|
||||
|
||||
// unsigned int usage_count;
|
||||
// int mmaped;
|
||||
|
||||
unsigned int nstrings; /* Number of strings below. */
|
||||
union locale_data_value
|
||||
{
|
||||
const wchar_t *wstr;
|
||||
const char *string;
|
||||
unsigned int word;
|
||||
}
|
||||
values[0]; /* Items, usually pointers into `filedata'. */
|
||||
};
|
||||
|
||||
/* We know three kinds of collation sorting rules. */
|
||||
enum coll_sort_rule
|
||||
{
|
||||
illegal_0__,
|
||||
sort_forward,
|
||||
sort_backward,
|
||||
illegal_3__,
|
||||
sort_position,
|
||||
sort_forward_position,
|
||||
sort_backward_position,
|
||||
sort_mask
|
||||
};
|
||||
|
||||
/* We can map the types of the entries into a few categories. */
|
||||
enum value_type
|
||||
{
|
||||
none,
|
||||
string,
|
||||
stringarray,
|
||||
byte,
|
||||
bytearray,
|
||||
word
|
||||
};
|
||||
|
||||
|
||||
/* Structure to access `era' information from LC_TIME. */
|
||||
struct era_entry
|
||||
{
|
||||
u_int32_t direction; /* Contains '+' or '-'. */
|
||||
int32_t offset;
|
||||
int32_t start_date[3];
|
||||
int32_t stop_date[3];
|
||||
const char name_fmt[0];
|
||||
};
|
||||
|
||||
extern const char *const _nl_category_names[LC_ALL + 1];
|
||||
extern const size_t _nl_category_name_sizes[LC_ALL + 1];
|
||||
extern const struct locale_data * *const _nl_current[LC_ALL];
|
||||
|
||||
/* Name of the standard locale. */
|
||||
extern const char _nl_C_name[];
|
||||
|
||||
/* Extract the current CATEGORY locale's string for ITEM. */
|
||||
#define _NL_CURRENT(category, item) \
|
||||
(_nl_current_##category->values[_NL_ITEM_INDEX (item)].string)
|
||||
|
||||
/* Extract the current CATEGORY locale's word for ITEM. */
|
||||
#define _NL_CURRENT_WORD(category, item) \
|
||||
(_nl_current_##category->values[_NL_ITEM_INDEX (item)].word)
|
||||
|
||||
/* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */
|
||||
#define _NL_CURRENT_DEFINE(category) \
|
||||
extern const struct locale_data _nl_C_##category; \
|
||||
const struct locale_data *_nl_current_##category = &_nl_C_##category
|
||||
|
||||
/* Load the locale data for CATEGORY from the file specified by *NAME.
|
||||
If *NAME is "", use environment variables as specified by POSIX,
|
||||
and fill in *NAME with the actual name used. The directories
|
||||
listed in LOCALE_PATH are searched for the locale files. */
|
||||
extern const struct locale_data *_nl_find_locale (const char *locale_path,
|
||||
size_t locale_path_len,
|
||||
int category, char **name);
|
||||
|
||||
/* Try to load the file described by FILE. */
|
||||
extern void _nl_load_locale (struct loaded_l10nfile *file, int category);
|
||||
|
||||
|
||||
/* Return `era' entry which corresponds to TP. Used in strftime. */
|
||||
struct era_entry *_nl_get_era_entry (const struct tm *tp);
|
||||
|
||||
/* Return `alt_digit' which corresponds to NUMBER. Used in strftime. */
|
||||
const char *_nl_get_alt_digit (unsigned int number);
|
||||
|
||||
|
||||
/* Global variables for LC_COLLATE category data. */
|
||||
extern const u_int32_t *__collate_table;
|
||||
extern const u_int32_t *__collate_extra;
|
||||
extern const u_int32_t *__collate_element_hash;
|
||||
extern const char *__collate_element_strings;
|
||||
extern const wchar_t *__collate_element_values;
|
||||
extern const u_int32_t *__collate_symbol_hash;
|
||||
extern const char *__collate_symbol_strings;
|
||||
extern const u_int32_t *__collate_symbol_classes;
|
||||
|
||||
#endif /* localeinfo.h */
|
||||
279
STLPORT/src/c_locale_stub.cpp
Normal file
279
STLPORT/src/c_locale_stub.cpp
Normal file
@@ -0,0 +1,279 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
#include "c_locale.h"
|
||||
#include <limits.h>
|
||||
|
||||
# ifdef _STLP_REAL_LOCALE_IMPLEMENTED
|
||||
|
||||
// here, we'll put C locale implementation for those compilers where
|
||||
// it has to be done in C++
|
||||
|
||||
# else
|
||||
|
||||
/* This is a "stub" implementation of the "c_locale.h" interface,
|
||||
intended for operating systems where we have not yet written
|
||||
a real implementation. A C++ library using this stub implementation
|
||||
is still standard-conforming, since the C++ standard does not require
|
||||
that any locales other than "C" be supported.
|
||||
*/
|
||||
|
||||
/* Framework functions */
|
||||
|
||||
struct _Locale_ctype /* { } */ ;
|
||||
struct _Locale_numeric /* { } */;
|
||||
struct _Locale_time /* { } */;
|
||||
struct _Locale_collate /*{ } */;
|
||||
struct _Locale_monetary /* { } */;
|
||||
struct _Locale_messages /* { } */;
|
||||
|
||||
# ifdef __cplusplus
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
extern "C" {
|
||||
# define __DUMMY_PAR
|
||||
# define __DUMMY_PAR1
|
||||
# define __DUMMY_PAR2
|
||||
# define __DUMMY_PAR3
|
||||
# define __DUMMY_PAR4
|
||||
# define __DUMMY_PAR5
|
||||
# define __DUMMY_PAR6
|
||||
# define __DUMMY_PAR7
|
||||
# define __DUMMY_PAR8
|
||||
# endif
|
||||
|
||||
void* _Locale_ctype_create(const char * __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
void* _Locale_numeric_create(const char * __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
void*_Locale_time_create(const char * __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
void* _Locale_collate_create(const char *__DUMMY_PAR)
|
||||
{ return 0; }
|
||||
void* _Locale_monetary_create(const char * __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
void* _Locale_messages_create(const char *__DUMMY_PAR)
|
||||
{ return 0; }
|
||||
|
||||
const char* _Locale_ctype_default(char*) { return 0; }
|
||||
const char* _Locale_numeric_default(char *) { return 0; }
|
||||
const char* _Locale_time_default(char*) { return 0; }
|
||||
const char* _Locale_collate_default(char*) { return 0; }
|
||||
const char* _Locale_monetary_default(char*) { return 0; }
|
||||
const char* _Locale_messages_default(char*) { return 0; }
|
||||
|
||||
char* _Locale_ctype_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_numeric_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_time_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_collate_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_monetary_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_messages_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
|
||||
void _Locale_ctype_destroy(void* __DUMMY_PAR) {}
|
||||
void _Locale_numeric_destroy(void* __DUMMY_PAR) {}
|
||||
void _Locale_time_destroy(void* __DUMMY_PAR) {}
|
||||
void _Locale_collate_destroy(void* __DUMMY_PAR) {}
|
||||
void _Locale_monetary_destroy(void* __DUMMY_PAR) {}
|
||||
void _Locale_messages_destroy(void* __DUMMY_PAR) {}
|
||||
|
||||
char* _Locale_extract_ctype_name(const char* __DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_extract_numeric_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_extract_time_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_extract_collate_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_extract_monetary_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char* _Locale_extract_messages_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
|
||||
char* _Locale_compose_name(char*__DUMMY_PAR1, const char*__DUMMY_PAR2, const char*__DUMMY_PAR3,
|
||||
const char*__DUMMY_PAR4,
|
||||
const char*__DUMMY_PAR5, const char*__DUMMY_PAR6, const char*__DUMMY_PAR7, const char*__DUMMY_PAR8)
|
||||
{ return 0; }
|
||||
|
||||
|
||||
/* ctype */
|
||||
|
||||
const _Locale_mask_t* _Locale_ctype_table(struct _Locale_ctype* __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
int _Locale_toupper(struct _Locale_ctype*__DUMMY_PAR1, int __DUMMY_PAR) { return 0; }
|
||||
int _Locale_tolower(struct _Locale_ctype*__DUMMY_PAR1, int __DUMMY_PAR) { return 0; }
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_Locale_mask_t _Locale_wchar_ctype(struct _Locale_ctype*__DUMMY_PAR1, wint_t __DUMMY_PAR2, _Locale_mask_t __DUMMY_PAR3)
|
||||
{ return 0; }
|
||||
wint_t _Locale_wchar_tolower(struct _Locale_ctype*__DUMMY_PAR1, wint_t __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
wint_t _Locale_wchar_toupper(struct _Locale_ctype*__DUMMY_PAR1, wint_t __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
# endif
|
||||
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
|
||||
int _Locale_mb_cur_max (struct _Locale_ctype * __DUMMY_PAR) { return 0; }
|
||||
int _Locale_mb_cur_min (struct _Locale_ctype * __DUMMY_PAR) { return 0; }
|
||||
int _Locale_is_stateless (struct _Locale_ctype * __DUMMY_PAR) { return 1; }
|
||||
#ifndef _STLP_NO_WCHAR_T
|
||||
wint_t _Locale_btowc(struct _Locale_ctype * __DUMMY_PAR1, int __DUMMY_PAR) { return 0; }
|
||||
int _Locale_wctob(struct _Locale_ctype * __DUMMY_PAR2, wint_t __DUMMY_PAR) { return 0; }
|
||||
|
||||
size_t _Locale_mbtowc(struct _Locale_ctype *__DUMMY_PAR1,
|
||||
wchar_t *__DUMMY_PAR2,
|
||||
const char *__DUMMY_PAR3, size_t __DUMMY_PAR4,
|
||||
mbstate_t *__DUMMY_PAR5) {
|
||||
return (size_t) -1;
|
||||
}
|
||||
size_t _Locale_wctomb(struct _Locale_ctype *__DUMMY_PAR1,
|
||||
char *__DUMMY_PAR2, size_t __DUMMY_PAR3,
|
||||
const wchar_t __DUMMY_PAR4,
|
||||
mbstate_t *__DUMMY_PAR5) {
|
||||
return (size_t) -1;
|
||||
}
|
||||
# endif
|
||||
|
||||
size_t _Locale_unshift(struct _Locale_ctype *__DUMMY_PAR1,
|
||||
mbstate_t *__DUMMY_PAR2,
|
||||
char *__DUMMY_PAR3, size_t __DUMMY_PAR4, char ** __DUMMY_PAR5) {
|
||||
return (size_t) -1;
|
||||
}
|
||||
|
||||
# endif /* _STLP_NO_MBSTATE_T */
|
||||
|
||||
|
||||
/* Collate */
|
||||
int _Locale_strcmp(struct _Locale_collate* __DUMMY_PAR1,
|
||||
const char* __DUMMY_PAR2, size_t __DUMMY_PAR3, const char* __DUMMY_PAR4,
|
||||
size_t __DUMMY_PAR5) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
int _Locale_strwcmp(struct _Locale_collate* __DUMMY_PAR1,
|
||||
const wchar_t* __DUMMY_PAR2, size_t __DUMMY_PAR3,
|
||||
const wchar_t* __DUMMY_PAR4, size_t __DUMMY_PAR5) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
size_t _Locale_strxfrm(struct _Locale_collate* __DUMMY_PAR1,
|
||||
char* __DUMMY_PAR2, size_t __DUMMY_PAR3,
|
||||
const char* __DUMMY_PAR4, size_t __DUMMY_PAR5) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
size_t _Locale_strwxfrm(struct _Locale_collate* __DUMMY_PAR1,
|
||||
wchar_t* __DUMMY_PAR2, size_t __DUMMY_PAR3,
|
||||
const wchar_t* __DUMMY_PAR4, size_t __DUMMY_PAR5)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
/* Numeric */
|
||||
|
||||
char _Locale_decimal_point(struct _Locale_numeric* __DUMMY_PAR) { return '.'; }
|
||||
char _Locale_thousands_sep(struct _Locale_numeric* __DUMMY_PAR) { return ','; }
|
||||
const char* _Locale_grouping(struct _Locale_numeric * __DUMMY_PAR)
|
||||
{ return ""; }
|
||||
|
||||
const char * _Locale_true(struct _Locale_numeric * __DUMMY_PAR) { return 0; }
|
||||
const char * _Locale_false(struct _Locale_numeric * __DUMMY_PAR) { return 0; }
|
||||
|
||||
|
||||
/* Monetary */
|
||||
|
||||
const char* _Locale_int_curr_symbol(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
const char* _Locale_currency_symbol(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return 0; }
|
||||
char _Locale_mon_decimal_point(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return '.'; }
|
||||
char _Locale_mon_thousands_sep(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return ','; }
|
||||
const char* _Locale_mon_grouping(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return ""; }
|
||||
const char* _Locale_positive_sign(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return ""; }
|
||||
const char* _Locale_negative_sign(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return ""; }
|
||||
char _Locale_int_frac_digits(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return CHAR_MAX; }
|
||||
char _Locale_frac_digits(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return CHAR_MAX; }
|
||||
int _Locale_p_cs_precedes(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return CHAR_MAX; }
|
||||
int _Locale_p_sep_by_space(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return CHAR_MAX; }
|
||||
int _Locale_p_sign_posn(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return CHAR_MAX; }
|
||||
int _Locale_n_cs_precedes(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return CHAR_MAX; }
|
||||
int _Locale_n_sep_by_space(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return CHAR_MAX; }
|
||||
int _Locale_n_sign_posn(struct _Locale_monetary * __DUMMY_PAR)
|
||||
{ return CHAR_MAX; }
|
||||
|
||||
|
||||
/* Time */
|
||||
const char * _Locale_full_monthname(struct _Locale_time * __DUMMY_PAR1, int __DUMMY_PAR2)
|
||||
{ return 0; }
|
||||
const char * _Locale_abbrev_monthname(struct _Locale_time * __DUMMY_PAR1, int __DUMMY_PAR2)
|
||||
{ return 0; }
|
||||
const char * _Locale_full_dayofweek(struct _Locale_time * __DUMMY_PAR1, int __DUMMY_PAR2)
|
||||
{ return 0; }
|
||||
const char * _Locale_abbrev_dayofweek(struct _Locale_time * __DUMMY_PAR1, int __DUMMY_PAR2)
|
||||
{ return 0; }
|
||||
|
||||
const char* _Locale_d_t_fmt(struct _Locale_time* __DUMMY_PAR) { return 0; }
|
||||
const char* _Locale_d_fmt(struct _Locale_time* __DUMMY_PAR) { return 0; }
|
||||
const char* _Locale_t_fmt(struct _Locale_time* __DUMMY_PAR) { return 0; }
|
||||
const char* _Locale_long_d_t_fmt(struct _Locale_time* __DUMMY_PAR){ return 0; }
|
||||
const char* _Locale_long_d_fmt(struct _Locale_time* __DUMMY_PAR) { return 0; }
|
||||
const char* _Locale_am_str(struct _Locale_time* __DUMMY_PAR) { return 0; }
|
||||
const char* _Locale_pm_str(struct _Locale_time* __DUMMY_PAR) { return 0; }
|
||||
const char* _Locale_t_fmt_ampm(struct _Locale_time* __DUMMY_PAR) { return 0; }
|
||||
|
||||
/* Messages */
|
||||
|
||||
int _Locale_catopen(struct _Locale_messages* __DUMMY_PAR1, const char* __DUMMY_PAR)
|
||||
{ return -1; }
|
||||
void _Locale_catclose(struct _Locale_messages* __DUMMY_PAR1, int __DUMMY_PAR) {}
|
||||
const char* _Locale_catgets(struct _Locale_messages* __DUMMY_PAR1, int __DUMMY_PAR2,
|
||||
int __DUMMY_PAR3, int __DUMMY_PAR4,
|
||||
const char *dfault)
|
||||
{ return dfault; }
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern C */
|
||||
_STLP_END_NAMESPACE
|
||||
#endif
|
||||
|
||||
#endif /* real locale */
|
||||
1743
STLPORT/src/c_locale_win32/c_locale_win32.c
Normal file
1743
STLPORT/src/c_locale_win32/c_locale_win32.c
Normal file
File diff suppressed because it is too large
Load Diff
165
STLPORT/src/codecvt.cpp
Normal file
165
STLPORT/src/codecvt.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
|
||||
#include <stl/_codecvt.h>
|
||||
#include <stl/_algobase.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// codecvt<char, char, mbstate_t>
|
||||
|
||||
codecvt<char, char, mbstate_t>::~codecvt() {}
|
||||
|
||||
int codecvt<char, char, mbstate_t>::do_length(const mbstate_t&,
|
||||
const char* from,
|
||||
const char* end,
|
||||
size_t mx) const
|
||||
{
|
||||
return (int)(min) ( __STATIC_CAST(size_t, (end - from)), mx);
|
||||
}
|
||||
|
||||
int codecvt<char, char, mbstate_t>::do_max_length() const _STLP_NOTHROW
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool
|
||||
codecvt<char, char, mbstate_t>::do_always_noconv() const _STLP_NOTHROW
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
codecvt<char, char, mbstate_t>::do_encoding() const _STLP_NOTHROW
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
codecvt_base::result
|
||||
codecvt<char, char, mbstate_t>::do_unshift(mbstate_t& /* __state */,
|
||||
char* __to,
|
||||
char* /* __to_limit */,
|
||||
char*& __to_next) const
|
||||
{ __to_next = __to; return noconv; }
|
||||
|
||||
codecvt_base::result
|
||||
codecvt<char, char, mbstate_t>::do_in (mbstate_t& /* __state */ ,
|
||||
const char* __from,
|
||||
const char* /* __from_end */,
|
||||
const char*& __from_next,
|
||||
char* __to,
|
||||
char* /* __to_end */,
|
||||
char*& __to_next) const
|
||||
{ __from_next = __from; __to_next = __to; return noconv; }
|
||||
|
||||
codecvt_base::result
|
||||
codecvt<char, char, mbstate_t>::do_out(mbstate_t& /* __state */,
|
||||
const char* __from,
|
||||
const char* /* __from_end */,
|
||||
const char*& __from_next,
|
||||
char* __to,
|
||||
char* /* __to_limit */,
|
||||
char*& __to_next) const
|
||||
{ __from_next = __from; __to_next = __to; return noconv; }
|
||||
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
//----------------------------------------------------------------------
|
||||
// codecvt<wchar_t, char, mbstate_t>
|
||||
|
||||
codecvt<wchar_t, char, mbstate_t>::~codecvt() {}
|
||||
|
||||
|
||||
codecvt<wchar_t, char, mbstate_t>::result
|
||||
codecvt<wchar_t, char, mbstate_t>::do_out(state_type& /* state */,
|
||||
const intern_type* from,
|
||||
const intern_type* from_end,
|
||||
const intern_type*& from_next,
|
||||
extern_type* to,
|
||||
extern_type* to_limit,
|
||||
extern_type*& to_next) const
|
||||
{
|
||||
ptrdiff_t len = (min) (from_end - from, to_limit - to);
|
||||
copy(from, from + len, to);
|
||||
from_next = from + len;
|
||||
to_next = to + len;
|
||||
return ok;
|
||||
}
|
||||
|
||||
codecvt<wchar_t, char, mbstate_t>::result
|
||||
codecvt<wchar_t, char, mbstate_t>::do_in (state_type& /* state */,
|
||||
const extern_type* from,
|
||||
const extern_type* from_end,
|
||||
const extern_type*& from_next,
|
||||
intern_type* to,
|
||||
intern_type* to_limit,
|
||||
intern_type*& to_next) const
|
||||
{
|
||||
ptrdiff_t len = (min) (from_end - from, to_limit - to);
|
||||
copy(from, from + len, to);
|
||||
from_next = from + len;
|
||||
to_next = to + len;
|
||||
return ok;
|
||||
}
|
||||
|
||||
codecvt<wchar_t, char, mbstate_t>::result
|
||||
codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& /* state */,
|
||||
extern_type* to,
|
||||
extern_type* ,
|
||||
extern_type*& to_next) const
|
||||
{
|
||||
to_next = to;
|
||||
return noconv;
|
||||
}
|
||||
|
||||
int codecvt<wchar_t, char, mbstate_t>::do_encoding() const _STLP_NOTHROW {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
bool codecvt<wchar_t, char, mbstate_t>::do_always_noconv() const _STLP_NOTHROW
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int codecvt<wchar_t, char, mbstate_t>::do_length(const state_type&,
|
||||
const extern_type* from,
|
||||
const extern_type* end,
|
||||
size_t mx) const
|
||||
{
|
||||
return (int)(min) ((size_t) (end - from), mx);
|
||||
}
|
||||
|
||||
int codecvt<wchar_t, char, mbstate_t>::do_max_length() const _STLP_NOTHROW {
|
||||
return 1;
|
||||
}
|
||||
# endif /* wchar_t */
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
# endif /* _STLP_NO_MBSTATE_T */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
83
STLPORT/src/collate.cpp
Normal file
83
STLPORT/src/collate.cpp
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
#include "stl/_collate.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
// collate<char>
|
||||
|
||||
collate<char>::~collate() {}
|
||||
|
||||
int collate<char>::do_compare(const char* low1, const char* high1,
|
||||
const char* low2, const char* high2) const
|
||||
{
|
||||
return __lexicographical_compare_3way(low1, high1, low2, high2);
|
||||
}
|
||||
|
||||
string collate<char>::do_transform(const char* low, const char* high) const
|
||||
{
|
||||
return string(low, high);
|
||||
}
|
||||
|
||||
long collate<char>::do_hash(const char* low, const char* high) const {
|
||||
unsigned long result = 0;
|
||||
for ( ; low < high; ++low)
|
||||
result = 5 * result + *low;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
// collate<wchar_t>
|
||||
|
||||
collate<wchar_t>::~collate() {}
|
||||
|
||||
int
|
||||
collate<wchar_t>::do_compare(const wchar_t* low1, const wchar_t* high1,
|
||||
const wchar_t* low2, const wchar_t* high2) const
|
||||
{
|
||||
return __lexicographical_compare_3way(low1, high1, low2, high2);
|
||||
}
|
||||
|
||||
|
||||
wstring
|
||||
collate<wchar_t>::do_transform(const wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
return wstring(low, high);
|
||||
}
|
||||
|
||||
long collate<wchar_t>::do_hash(const wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
unsigned long result = 0;
|
||||
for ( ; low < high; ++low)
|
||||
result = 5 * result + *low;
|
||||
return result;
|
||||
}
|
||||
# endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
416
STLPORT/src/common_macros.mak
Normal file
416
STLPORT/src/common_macros.mak
Normal file
@@ -0,0 +1,416 @@
|
||||
SHELL=/bin/sh
|
||||
|
||||
#
|
||||
# Versioning
|
||||
#
|
||||
VERSION_MAJOR=4
|
||||
VERSION_MINOR=6
|
||||
|
||||
# This one is not always present; it should be empty for release versions.
|
||||
# We do not assume any binary compatibility for betas.
|
||||
BETA_SUFFIX=
|
||||
|
||||
VERSION_SUFFIX= .$(VERSION_MAJOR).$(VERSION_MINOR)$(BETA_SUFFIX)
|
||||
WIN_VERSION_SUFFIX= $(VERSION_MAJOR)$(VERSION_MINOR)$(BETA_SUFFIX)
|
||||
|
||||
# DYNAMIC_SUFFIX= $(VERSION_SUFFIX)$(PATCH_SUFFIX)
|
||||
DYNAMIC_SUFFIX= $(VERSION_SUFFIX)
|
||||
WIN_DYNAMIC_SUFFIX= $(WIN_VERSION_SUFFIX)
|
||||
|
||||
#
|
||||
# Directories
|
||||
#
|
||||
#
|
||||
|
||||
SRCDIR=.
|
||||
STLPORT_DIR=$(CUR_DIR)..$(PATH_SEP)stlport
|
||||
OUTDIR=$(CUR_DIR)..$(PATH_SEP)lib
|
||||
OBJDIR_COMMON=$(OUTDIR)$(PATH_SEP)obj
|
||||
OBJDIR=$(OUTDIR)$(PATH_SEP)obj$(PATH_SEP)$(COMP)
|
||||
|
||||
RELEASE_OBJDIR_static=$(OBJDIR)$(PATH_SEP)Release
|
||||
DEBUG_OBJDIR_static=$(OBJDIR)$(PATH_SEP)Debug
|
||||
STLDEBUG_OBJDIR_static=$(OBJDIR)$(PATH_SEP)DebugSTL
|
||||
RELEASE_OBJDIR_staticx=$(OBJDIR)$(PATH_SEP)Releasex
|
||||
DEBUG_OBJDIR_staticx=$(OBJDIR)$(PATH_SEP)Debugx
|
||||
STLDEBUG_OBJDIR_staticx=$(OBJDIR)$(PATH_SEP)DebugSTLx
|
||||
RELEASE_OBJDIR_dynamic=$(OBJDIR)$(PATH_SEP)ReleaseD
|
||||
DEBUG_OBJDIR_dynamic=$(OBJDIR)$(PATH_SEP)DebugD
|
||||
STLDEBUG_OBJDIR_dynamic=$(OBJDIR)$(PATH_SEP)DebugSTLD
|
||||
|
||||
#
|
||||
# By default on UNIX, STLport headers go into /usr/local/include/stlport,
|
||||
# and libraries go into /usr/local/lib. Please override any of them if desired.
|
||||
#
|
||||
|
||||
INSTALLDIR=/usr/local
|
||||
# INSTALLDIR=/tmp
|
||||
INSTALLDIR_INC=$(INSTALLDIR)/include/stlport
|
||||
INSTALLDIR_LIB=$(INSTALLDIR)/lib
|
||||
|
||||
RM = rm -fr
|
||||
INSTALL = ./install.sh -c
|
||||
INSTALL_LIB = $(INSTALL)
|
||||
INSTALL_H = $(INSTALL) -m 444
|
||||
|
||||
#
|
||||
#
|
||||
# Targets
|
||||
#
|
||||
|
||||
RELEASE_NAME=$(LIB_BASENAME)
|
||||
DEBUG_NAME=$(LIB_BASENAME)_debug
|
||||
STLDEBUG_NAME=$(LIB_BASENAME)_stldebug
|
||||
|
||||
RELEASE_DYNLIB=$(RELEASE_NAME).$(DYNEXT)$(DYNAMIC_SUFFIX)
|
||||
DEBUG_DYNLIB=$(DEBUG_NAME).$(DYNEXT)$(DYNAMIC_SUFFIX)
|
||||
STLDEBUG_DYNLIB=$(STLDEBUG_NAME).$(DYNEXT)$(DYNAMIC_SUFFIX)
|
||||
|
||||
RELEASE_DYNLIB_SONAME=$(RELEASE_NAME).$(DYNEXT)$(VERSION_SUFFIX)
|
||||
DEBUG_DYNLIB_SONAME=$(DEBUG_NAME).$(DYNEXT)$(VERSION_SUFFIX)
|
||||
STLDEBUG_DYNLIB_SONAME=$(STLDEBUG_NAME).$(DYNEXT)$(VERSION_SUFFIX)
|
||||
|
||||
RELEASE_LIB=$(RELEASE_NAME)$(STATIC_SUFFIX).$(STEXT)
|
||||
DEBUG_LIB=$(DEBUG_NAME)$(STATIC_SUFFIX).$(STEXT)
|
||||
STLDEBUG_LIB=$(STLDEBUG_NAME)$(STATIC_SUFFIX).$(STEXT)
|
||||
|
||||
RELEASEX_LIB=$(RELEASE_NAME)$(STATIC_SUFFIX)x.$(STEXT)
|
||||
DEBUGX_LIB=$(DEBUG_NAME)$(STATIC_SUFFIX)x.$(STEXT)
|
||||
STLDEBUGX_LIB=$(STLDEBUG_NAME)$(STATIC_SUFFIX)x.$(STEXT)
|
||||
|
||||
ALL_STATIC_LIBS=$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB)
|
||||
DEBUG_STATIC_LIBS=$(ALL_STATIC_LIBS) $(OUTDIR)$(PATH_SEP)$(DEBUG_LIB)
|
||||
|
||||
ALL_STATICX_LIBS=$(OUTDIR)$(PATH_SEP)$(RELEASEX_LIB) $(OUTDIR)$(PATH_SEP)$(STLDEBUGX_LIB)
|
||||
DEBUG_STATICX_LIBS=$(ALL_STATICX_LIBS) $(OUTDIR)$(PATH_SEP)$(DEBUGX_LIB)
|
||||
|
||||
ALL_DYNAMIC_LIBS=$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB)
|
||||
DEBUG_DYNAMIC_LIBS=$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB)
|
||||
|
||||
|
||||
RELEASE_OBJECTS_static= \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
|
||||
DEBUG_OBJECTS_static= \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
STLDEBUG_OBJECTS_static= \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_static)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
###########################################################
|
||||
|
||||
RELEASE_OBJECTS_staticx= \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_staticx)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
|
||||
DEBUG_OBJECTS_staticx= \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_staticx)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
STLDEBUG_OBJECTS_staticx= \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_staticx)$(PATH_SEP)string_w.$(OBJEXT)
|
||||
|
||||
|
||||
###########################################################
|
||||
|
||||
RELEASE_OBJECTS_dynamic= \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)string_w.$(OBJEXT) \
|
||||
$(RESFILE)
|
||||
|
||||
DEBUG_OBJECTS_dynamic= \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)string_w.$(OBJEXT) \
|
||||
$(RESFILE_debug)
|
||||
|
||||
STLDEBUG_OBJECTS_dynamic= \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)dll_main.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)fstream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)strstream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)sstream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)ios.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)streambuf.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)stdio_streambuf.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)istream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)ostream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)iostream.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)codecvt.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)collate.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)ctype.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)monetary.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)num_get.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)num_put.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)num_get_float.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)num_put_float.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)numpunct.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)time_facets.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)messages.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)locale_impl.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)locale.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)locale_catalog.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)facets_byname.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)c_locale.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)c_locale_stub.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)complex.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)complex_exp.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)complex_io.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)complex_trig.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)complex_io_w.$(OBJEXT) \
|
||||
$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)string_w.$(OBJEXT) \
|
||||
$(RESFILE_stldebug)
|
||||
|
||||
|
||||
30
STLPORT/src/common_macros_windows.mak
Normal file
30
STLPORT/src/common_macros_windows.mak
Normal file
@@ -0,0 +1,30 @@
|
||||
SHELL=/bin/sh
|
||||
|
||||
!include common_macros.mak
|
||||
|
||||
# INSTALLDIR=/usr/local
|
||||
# INSTALLDIR_INC=$(INSTALLDIR)/include/stlport
|
||||
# INSTALLDIR_LIB=$(INSTALLDIR)/lib
|
||||
|
||||
# RM = rm -fr
|
||||
|
||||
# INSTALL = ./install.sh -c
|
||||
# INSTALL_LIB = $(INSTALL)
|
||||
# INSTALL_H = $(INSTALL) -m 444
|
||||
|
||||
#
|
||||
#
|
||||
# Targets
|
||||
#
|
||||
|
||||
# those are defined "Unix way" in common_macros.mak; redefine them here
|
||||
RELEASE_DYNLIB=$(RELEASE_NAME)$(WIN_DYNAMIC_SUFFIX).$(DYNEXT)
|
||||
DEBUG_DYNLIB=$(DEBUG_NAME)$(WIN_DYNAMIC_SUFFIX).$(DYNEXT)
|
||||
STLDEBUG_DYNLIB=$(STLDEBUG_NAME)$(WIN_DYNAMIC_SUFFIX).$(DYNEXT)
|
||||
|
||||
RELEASE_DYNLIB_SONAME=$(RELEASE_NAME)$(WIN_VERSION_SUFFIX).$(DYNEXT)
|
||||
DEBUG_DYNLIB_SONAME=$(DEBUG_NAME)$(WIN_VERSION_SUFFIX).$(DYNEXT)
|
||||
STLDEBUG_DYNLIB_SONAME=$(STLDEBUG_NAME)$(WIN_VERSION_SUFFIX).$(DYNEXT)
|
||||
|
||||
ALL_DYNAMIC_LIBS=$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB)
|
||||
DEBUG_DYNAMIC_LIBS=$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) $(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB)
|
||||
46
STLPORT/src/common_percent_rules.mak
Normal file
46
STLPORT/src/common_percent_rules.mak
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
.SUFFIXES: .cpp .c .o .so .a
|
||||
|
||||
$(RELEASE_OBJDIR_static)/%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS_RELEASE_static) $< -c -o $@
|
||||
$(RELEASE_OBJDIR_static)/%.o: %.c
|
||||
$(CC) $(CXXFLAGS_RELEASE_static) $< -c -o $@
|
||||
$(RELEASE_OBJDIR_static)/%.i : %.cpp
|
||||
$(CXX) $(CXXFLAGS_RELEASE_static) $< -E $@
|
||||
|
||||
$(RELEASE_OBJDIR_dynamic)/%.o : %.cpp
|
||||
$(CXX) $(CXXFLAGS_RELEASE_dynamic) $< -c -o $@
|
||||
$(RELEASE_OBJDIR_dynamic)/%.o : %.c
|
||||
$(CC) $(CXXFLAGS_RELEASE_dynamic) $< -c -o $@
|
||||
$(RELEASE_OBJDIR_dynamic)/%.i : %.cpp
|
||||
$(CXX) $(CXXFLAGS_RELEASE_dynamic) $< -E $@
|
||||
|
||||
$(DEBUG_OBJDIR_static)/%.o : %.cpp
|
||||
$(CXX) $(CXXFLAGS_DEBUG_static) $< -c -o $@
|
||||
$(DEBUG_OBJDIR_static)/%.o : %.c
|
||||
$(CC) $(CXXFLAGS_DEBUG_static) $< -c -o $@
|
||||
$(DEBUG_OBJDIR_static)/%.i : %.cpp
|
||||
$(CXX) $(CXXFLAGS_DEBUG_static) $< -E $@
|
||||
|
||||
$(DEBUG_OBJDIR_dynamic)/%.o : %.cpp
|
||||
$(CXX) $(CXXFLAGS_DEBUG_dynamic) $< -c -o $@
|
||||
$(DEBUG_OBJDIR_dynamic)/%.o : %.c
|
||||
$(CC) $(CXXFLAGS_DEBUG_dynamic) $< -c -o $@
|
||||
$(DEBUG_OBJDIR_dynamic)/%.i : %.cpp
|
||||
$(CXX) $(CXXFLAGS_DEBUG_dynamic) $< -E $@
|
||||
|
||||
$(STLDEBUG_OBJDIR_static)/%.o : %.cpp
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_static) $< -c -o $@
|
||||
$(STLDEBUG_OBJDIR_static)/%.o : %.c
|
||||
$(CC) $(CXXFLAGS_STLDEBUG_static) $< -c -o $@
|
||||
$(STLDEBUG_OBJDIR_static)/%.i : %.cpp
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_static) $< -E $@
|
||||
|
||||
$(STLDEBUG_OBJDIR_dynamic)/%.o : %.cpp
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_dynamic) $< -c -o $@
|
||||
$(STLDEBUG_OBJDIR_dynamic)/%.o : %.c
|
||||
$(CC) $(CXXFLAGS_STLDEBUG_dynamic) $< -c -o $@
|
||||
$(STLDEBUG_OBJDIR_dynamic)/%.i : %.cpp
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_dynamic) $< -E $@
|
||||
|
||||
|
||||
160
STLPORT/src/common_rules.mak
Normal file
160
STLPORT/src/common_rules.mak
Normal file
@@ -0,0 +1,160 @@
|
||||
#
|
||||
# Target directories
|
||||
#
|
||||
#
|
||||
|
||||
$(OUTDIR) :
|
||||
$(MKDIR) $(OUTDIR)
|
||||
$(RELEASE_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_dynamic)
|
||||
$(DEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_dynamic)
|
||||
$(STLDEBUG_OBJDIR_dynamic) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_dynamic)
|
||||
$(RELEASE_OBJDIR_static) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_static)
|
||||
$(DEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_static)
|
||||
$(STLDEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_static)
|
||||
$(RELEASE_OBJDIR_staticx) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_staticx)
|
||||
$(DEBUG_OBJDIR_staticx) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_staticx)
|
||||
$(STLDEBUG_OBJDIR_staticx) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_staticx)
|
||||
|
||||
#create a compiler platform directory
|
||||
platform: $(PREPARE_STEP)
|
||||
-@$(MKDIR) $(OUTDIR)
|
||||
-@$(MKDIR) $(OBJDIR_COMMON)
|
||||
-@$(MKDIR) $(OBJDIR)
|
||||
|
||||
prepare: $(PREPARE_STEP)
|
||||
@echo "STLport installation is prepared for use in-place. No iostreams are built yet !"
|
||||
@echo "To build and use STLport iostreams, please do : make -f <this makefile> all."
|
||||
@echo "To install STLport in a designated directory, please do : make -f <this makefile> install."
|
||||
|
||||
clean_all_obj:
|
||||
-$(RM) $(OUTDIR)$(PATH_SEP)obj
|
||||
|
||||
###### Targets ##################
|
||||
|
||||
all_static : platform $(ALL_STATIC_LIBS)
|
||||
|
||||
all_dynamic : platform $(ALL_DYNAMIC_LIBS)
|
||||
|
||||
all_staticx : platform $(ALL_STATICX_LIBS)
|
||||
|
||||
release_static : platform $(OUTDIR)$(PATH_SEP)$(RELEASE_LIB)
|
||||
|
||||
debug_static : platform $(OUTDIR)$(PATH_SEP)$(DEBUG_LIB)
|
||||
|
||||
stldebug_static : platform $(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB)
|
||||
|
||||
release_staticx : platform $(OUTDIR)$(PATH_SEP)$(RELEASEX_LIB)
|
||||
|
||||
debug_staticx : platform $(OUTDIR)$(PATH_SEP)$(DEBUGX_LIB)
|
||||
|
||||
stldebug_staticx : platform $(OUTDIR)$(PATH_SEP)$(STLDEBUGX_LIB)
|
||||
|
||||
release_dynamic : platform $(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB)
|
||||
|
||||
debug_dynamic : platform $(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB)
|
||||
|
||||
stldebug_dynamic : platform $(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB)
|
||||
|
||||
install : all $(INSTALL_STEP)
|
||||
|
||||
clean : $(CLEAN_SPECIFIC)
|
||||
-$(RM) $(RELEASE_OBJDIR_static) $(DEBUG_OBJDIR_static) $(STLDEBUG_OBJDIR_static) \
|
||||
$(RELEASE_OBJDIR_staticx) $(DEBUG_OBJDIR_staticx) $(STLDEBUG_OBJDIR_staticx) \
|
||||
$(RELEASE_OBJDIR_dynamic) $(DEBUG_OBJDIR_dynamic) $(STLDEBUG_OBJDIR_dynamic) \
|
||||
$(OUTDIR)$(PATH_SEP)SunWS_cache SunWS_cache $(OUTDIR)$(PATH_SEP)Templates.DB Templates.DB tempinc
|
||||
|
||||
clobber : clean clean_all_obj
|
||||
-$(RM) $(OUTDIR)$(PATH_SEP)$(DEBUG_NAME).* \
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_NAME).* $(OUTDIR)$(PATH_SEP)$(STLDEBUG_NAME).*
|
||||
|
||||
HEADER_DIRS1 = . using wrap_std old_hp
|
||||
HEADER_DIRS2 = config stl stl/debug stl/wrappers using/h wrap_std/h
|
||||
|
||||
symbolic_links :
|
||||
$(RM) $(OUTDIR)/$(RELEASE_NAME).$(DYNEXT)
|
||||
$(RM) $(OUTDIR)/$(STLDEBUG_NAME).$(DYNEXT)
|
||||
$(RM) $(OUTDIR)/$(DEBUG_NAME).$(DYNEXT)
|
||||
ln -s $(RELEASE_DYNLIB) $(OUTDIR)/$(RELEASE_NAME).$(DYNEXT)
|
||||
-ln -s $(DEBUG_DYNLIB) $(OUTDIR)/$(DEBUG_NAME).$(DYNEXT)
|
||||
ln -s $(STLDEBUG_DYNLIB) $(OUTDIR)/$(STLDEBUG_NAME).$(DYNEXT)
|
||||
|
||||
install_unix :
|
||||
-$(RM) $(INSTALLDIR_INC)
|
||||
for dir in $(HEADER_DIRS1); \
|
||||
do \
|
||||
./mkinstalldirs $(INSTALLDIR_INC)/$$dir; \
|
||||
for file in `cat ../stlport/$$dir/export`; \
|
||||
do \
|
||||
$(INSTALL_H) ../stlport/$$dir/$$file $(INSTALLDIR_INC)/$$dir ; \
|
||||
done \
|
||||
done
|
||||
for dir in $(HEADER_DIRS2); \
|
||||
do \
|
||||
./mkinstalldirs $(INSTALLDIR_INC)/$$dir; \
|
||||
for file in `ls ../stlport/$$dir/*.*`; \
|
||||
do \
|
||||
$(INSTALL_H) $$file $(INSTALLDIR_INC)/$$dir ; \
|
||||
done \
|
||||
done
|
||||
./mkinstalldirs $(INSTALLDIR_LIB)
|
||||
for file in `ls $(OUTDIR)/$(LIB_BASENAME)*`; \
|
||||
do \
|
||||
$(RM) $(INSTALLDIR_LIB)/$$file; \
|
||||
$(INSTALL_LIB) $$file $(INSTALLDIR_LIB); \
|
||||
done
|
||||
$(RM) $(INSTALLDIR_LIB)/$(RELEASE_NAME).$(DYNEXT)
|
||||
$(RM) $(INSTALLDIR_LIB)/$(STLDEBUG_NAME).$(DYNEXT)
|
||||
ln -s $(RELEASE_DYNLIB) $(INSTALLDIR_LIB)/$(RELEASE_NAME).$(DYNEXT)
|
||||
ln -s $(STLDEBUG_DYNLIB) $(INSTALLDIR_LIB)/$(STLDEBUG_NAME).$(DYNEXT)
|
||||
|
||||
# ln -s $(INSTALLDIR_LIB)/$(RELEASE_DYNLIB) $(INSTALLDIR_LIB)/$(RELEASE_NAME).$(DYNEXT)
|
||||
# ln -s $(INSTALLDIR_LIB)/$(STLDEBUG_DYNLIB) $(INSTALLDIR_LIB)/$(STLDEBUG_NAME).$(DYNEXT)
|
||||
|
||||
install_sun : install_unix
|
||||
for file in `cat ../stlport/$$dir/export.sun`; \
|
||||
do \
|
||||
$(INSTALL_H) ../stlport/$$dir/$$file $(INSTALLDIR_INC)/$$dir ; \
|
||||
done
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) : $(OUTDIR) $(RELEASE_OBJDIR_dynamic) $(DEF_FILE) $(RELEASE_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(RELEASE_DYNLIB) $(LDFLAGS_RELEASE_dynamic) $(RELEASE_OBJECTS_dynamic) $(LDLIBS_RELEASE_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) : $(OUTDIR) $(RELEASE_OBJDIR_static) $(DEF_FILE) $(RELEASE_OBJECTS_static)
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) $(LDFLAGS_RELEASE_static) $(RELEASE_OBJECTS_static) $(LDLIBS_RELEASE_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASEX_LIB) : $(OUTDIR) $(RELEASE_OBJDIR_staticx) $(DEF_FILE) $(RELEASE_OBJECTS_staticx)
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(RELEASEX_LIB) $(LDFLAGS_RELEASE_static) $(RELEASE_OBJECTS_staticx) $(LDLIBS_RELEASE_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) : $(OUTDIR) $(DEBUG_OBJDIR_dynamic) $(DEF_FILE) $(DEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(DEBUG_DYNLIB) $(LDFLAGS_DEBUG_dynamic) $(DEBUG_OBJECTS_dynamic) $(LDLIBS_DEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) : $(OUTDIR) $(DEBUG_OBJDIR_static) $(DEF_FILE) $(DEBUG_OBJECTS_static)
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(DEBUG_LIB) $(LDLIBS_DEBUG_static) $(LDFLAGS_DEBUG_static) $(DEBUG_OBJECTS_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(DEBUGX_LIB) : $(OUTDIR) $(DEBUG_OBJDIR_staticx) $(DEF_FILE) $(DEBUG_OBJECTS_staticx)
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(DEBUGX_LIB) $(LDLIBS_DEBUG_static) $(LDFLAGS_DEBUG_static) $(DEBUG_OBJECTS_staticx)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) : $(OUTDIR) $(STLDEBUG_OBJDIR_dynamic) $(DEF_FILE) $(STLDEBUG_OBJECTS_dynamic)
|
||||
$(DYN_LINK) $(DYNLINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUG_DYNLIB) $(LDFLAGS_STLDEBUG_dynamic) $(STLDEBUG_OBJECTS_dynamic) $(LDLIBS_STLDEBUG_dynamic)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) : $(OUTDIR) $(STLDEBUG_OBJDIR_static) $(DEF_FILE) $(STLDEBUG_OBJECTS_static)
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) $(LDFLAGS_STLDEBUG_static) $(STLDEBUG_OBJECTS_static) $(LDLIBS_STLDEBUG_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUGX_LIB) : $(OUTDIR) $(STLDEBUG_OBJDIR_staticx) $(DEF_FILE) $(STLDEBUG_OBJECTS_staticx)
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUGX_LIB) $(LDFLAGS_STLDEBUG_static) $(STLDEBUG_OBJECTS_staticx) $(LDLIBS_STLDEBUG_static)
|
||||
|
||||
# locale_impl.cpp : codecvt.cpp collate.cpp ctype.cpp monetary.cpp num_get.cpp num_get_float.cpp num_put.cpp num_put_float.cpp numpunct.cpp time_facets.cpp messages.cpp
|
||||
|
||||
# locale_catalog.cpp : ctype_byname.cpp collate_byname.cpp codecvt_byname.cpp numpunct_byname.cpp monetary_byname.cpp messages_byname.cpp
|
||||
|
||||
|
||||
#########################################
|
||||
53
STLPORT/src/como.mak
Normal file
53
STLPORT/src/como.mak
Normal file
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# Note : this makefile has been only tested in como + gcc setup
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = como
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_como
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
DYN_LINK=-copt="-shared -all" -G -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=COMO_$(ARCH)
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -DLIBCIO= --diag_suppress=68
|
||||
|
||||
CXXFLAGS_COMMON = -I. -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -g -O
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -g -O -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
290
STLPORT/src/complex.cpp
Normal file
290
STLPORT/src/complex.cpp
Normal file
@@ -0,0 +1,290 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
// Complex division and square roots.
|
||||
|
||||
#include "complex_impl.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
// Absolute value
|
||||
_STLP_TEMPLATE_NULL
|
||||
_STLP_DECLSPEC float _STLP_CALL abs(const complex<float>& __z)
|
||||
{
|
||||
return _STLP_HYPOTF(__z._M_re, __z._M_im);
|
||||
}
|
||||
_STLP_TEMPLATE_NULL
|
||||
_STLP_DECLSPEC double _STLP_CALL abs(const complex<double>& __z)
|
||||
{
|
||||
return _STLP_HYPOT(__z._M_re, __z._M_im);
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_TEMPLATE_NULL
|
||||
_STLP_DECLSPEC long double _STLP_CALL abs(const complex<long double>& __z)
|
||||
{
|
||||
return _STLP_HYPOTL(__z._M_re, __z._M_im);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Phase
|
||||
|
||||
_STLP_TEMPLATE_NULL
|
||||
_STLP_DECLSPEC float _STLP_CALL arg(const complex<float>& __z)
|
||||
{
|
||||
return _STLP_ATAN2F(__z._M_im, __z._M_re);
|
||||
}
|
||||
|
||||
_STLP_TEMPLATE_NULL
|
||||
_STLP_DECLSPEC double _STLP_CALL arg(const complex<double>& __z)
|
||||
{
|
||||
return _STLP_ATAN2(__z._M_im, __z._M_re);
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_TEMPLATE_NULL
|
||||
_STLP_DECLSPEC long double _STLP_CALL arg(const complex<long double>& __z)
|
||||
{
|
||||
return _STLP_ATAN2L(__z._M_im, __z._M_re);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Construct a complex number from polar representation
|
||||
_STLP_TEMPLATE_NULL
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL polar(const float& __rho, const float& __phi)
|
||||
{
|
||||
return complex<float>(__rho * _STLP_COSF(__phi), __rho * _STLP_SINF(__phi));
|
||||
}
|
||||
_STLP_TEMPLATE_NULL
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL polar(const double& __rho, const double& __phi)
|
||||
{
|
||||
return complex<double>(__rho * _STLP_COS(__phi), __rho * _STLP_SIN(__phi));
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_TEMPLATE_NULL
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL polar(const long double& __rho, const long double& __phi)
|
||||
{
|
||||
return complex<long double>(__rho * _STLP_COSL(__phi), __rho * _STLP_SINL(__phi));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Division
|
||||
|
||||
void _STLP_CALL
|
||||
complex<float>::_div(const float& __z1_r, const float& __z1_i,
|
||||
const float& __z2_r, const float& __z2_i,
|
||||
float& __res_r, float& __res_i) {
|
||||
float __ar = __z2_r >= 0 ? __z2_r : -__z2_r;
|
||||
float __ai = __z2_i >= 0 ? __z2_i : -__z2_i;
|
||||
|
||||
if (__ar <= __ai) {
|
||||
float __ratio = __z2_r / __z2_i;
|
||||
float __denom = __z2_i * (1 + __ratio * __ratio);
|
||||
__res_r = (__z1_r * __ratio + __z1_i) / __denom;
|
||||
__res_i = (__z1_i * __ratio - __z1_r) / __denom;
|
||||
}
|
||||
else {
|
||||
float __ratio = __z2_i / __z2_r;
|
||||
float __denom = __z2_r * (1 + __ratio * __ratio);
|
||||
__res_r = (__z1_r + __z1_i * __ratio) / __denom;
|
||||
__res_i = (__z1_i - __z1_r * __ratio) / __denom;
|
||||
}
|
||||
}
|
||||
|
||||
void _STLP_CALL
|
||||
complex<float>::_div(const float& __z1_r,
|
||||
const float& __z2_r, const float& __z2_i,
|
||||
float& __res_r, float& __res_i) {
|
||||
float __ar = __z2_r >= 0 ? __z2_r : -__z2_r;
|
||||
float __ai = __z2_i >= 0 ? __z2_i : -__z2_i;
|
||||
|
||||
if (__ar <= __ai) {
|
||||
float __ratio = __z2_r / __z2_i;
|
||||
float __denom = __z2_i * (1 + __ratio * __ratio);
|
||||
__res_r = (__z1_r * __ratio) / __denom;
|
||||
__res_i = - __z1_r / __denom;
|
||||
}
|
||||
else {
|
||||
float __ratio = __z2_i / __z2_r;
|
||||
float __denom = __z2_r * (1 + __ratio * __ratio);
|
||||
__res_r = __z1_r / __denom;
|
||||
__res_i = - (__z1_r * __ratio) / __denom;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _STLP_CALL
|
||||
complex<double>::_div(const double& __z1_r, const double& __z1_i,
|
||||
const double& __z2_r, const double& __z2_i,
|
||||
double& __res_r, double& __res_i) {
|
||||
double __ar = __z2_r >= 0 ? __z2_r : -__z2_r;
|
||||
double __ai = __z2_i >= 0 ? __z2_i : -__z2_i;
|
||||
|
||||
if (__ar <= __ai) {
|
||||
double __ratio = __z2_r / __z2_i;
|
||||
double __denom = __z2_i * (1 + __ratio * __ratio);
|
||||
__res_r = (__z1_r * __ratio + __z1_i) / __denom;
|
||||
__res_i = (__z1_i * __ratio - __z1_r) / __denom;
|
||||
}
|
||||
else {
|
||||
double __ratio = __z2_i / __z2_r;
|
||||
double __denom = __z2_r * (1 + __ratio * __ratio);
|
||||
__res_r = (__z1_r + __z1_i * __ratio) / __denom;
|
||||
__res_i = (__z1_i - __z1_r * __ratio) / __denom;
|
||||
}
|
||||
}
|
||||
|
||||
void _STLP_CALL
|
||||
complex<double>::_div(const double& __z1_r,
|
||||
const double& __z2_r, const double& __z2_i,
|
||||
double& __res_r, double& __res_i) {
|
||||
double __ar = __z2_r >= 0 ? __z2_r : -__z2_r;
|
||||
double __ai = __z2_i >= 0 ? __z2_i : -__z2_i;
|
||||
|
||||
if (__ar <= __ai) {
|
||||
double __ratio = __z2_r / __z2_i;
|
||||
double __denom = __z2_i * (1 + __ratio * __ratio);
|
||||
__res_r = (__z1_r * __ratio) / __denom;
|
||||
__res_i = - __z1_r / __denom;
|
||||
}
|
||||
else {
|
||||
double __ratio = __z2_i / __z2_r;
|
||||
double __denom = __z2_r * (1 + __ratio * __ratio);
|
||||
__res_r = __z1_r / __denom;
|
||||
__res_i = - (__z1_r * __ratio) / __denom;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
void _STLP_CALL
|
||||
complex<long double>::_div(const long double& __z1_r, const long double& __z1_i,
|
||||
const long double& __z2_r, const long double& __z2_i,
|
||||
long double& __res_r, long double& __res_i) {
|
||||
long double __ar = __z2_r >= 0 ? __z2_r : -__z2_r;
|
||||
long double __ai = __z2_i >= 0 ? __z2_i : -__z2_i;
|
||||
|
||||
if (__ar <= __ai) {
|
||||
long double __ratio = __z2_r / __z2_i;
|
||||
long double __denom = __z2_i * (1 + __ratio * __ratio);
|
||||
__res_r = (__z1_r * __ratio + __z1_i) / __denom;
|
||||
__res_i = (__z1_i * __ratio - __z1_r) / __denom;
|
||||
}
|
||||
else {
|
||||
long double __ratio = __z2_i / __z2_r;
|
||||
long double __denom = __z2_r * (1 + __ratio * __ratio);
|
||||
__res_r = (__z1_r + __z1_i * __ratio) / __denom;
|
||||
__res_i = (__z1_i - __z1_r * __ratio) / __denom;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _STLP_CALL
|
||||
complex<long double>::_div(const long double& __z1_r,
|
||||
const long double& __z2_r, const long double& __z2_i,
|
||||
long double& __res_r, long double& __res_i) {
|
||||
long double __ar = __z2_r >= 0 ? __z2_r : -__z2_r;
|
||||
long double __ai = __z2_i >= 0 ? __z2_i : -__z2_i;
|
||||
|
||||
if (__ar <= __ai) {
|
||||
long double __ratio = __z2_r / __z2_i;
|
||||
long double __denom = __z2_i * (1 + __ratio * __ratio);
|
||||
__res_r = (__z1_r * __ratio) / __denom;
|
||||
__res_i = - __z1_r / __denom;
|
||||
}
|
||||
else {
|
||||
long double __ratio = __z2_i / __z2_r;
|
||||
long double __denom = __z2_r * (1 + __ratio * __ratio);
|
||||
__res_r = __z1_r / __denom;
|
||||
__res_i = - (__z1_r * __ratio) / __denom;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Square root
|
||||
|
||||
|
||||
complex<float> _STLP_CALL
|
||||
sqrt(const complex<float>& z) {
|
||||
float re = z._M_re;
|
||||
float im = z._M_im;
|
||||
float mag = _STLP_HYPOTF(re, im);
|
||||
complex<float> result;
|
||||
|
||||
if (mag == 0.) {
|
||||
result._M_re = result._M_im = 0.f;
|
||||
} else if (re > 0.f) {
|
||||
result._M_re = _STLP_SQRTF(0.5f * (mag + re));
|
||||
result._M_im = im/result._M_re/2.f;
|
||||
} else {
|
||||
result._M_im = _STLP_SQRTF(0.5f * (mag - re));
|
||||
if (im < 0.f)
|
||||
result._M_im = - result._M_im;
|
||||
result._M_re = im/result._M_im/2.f;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
complex<double> _STLP_CALL
|
||||
sqrt(const complex<double>& z) {
|
||||
double re = z._M_re;
|
||||
double im = z._M_im;
|
||||
double mag = _STLP_HYPOT(re, im);
|
||||
complex<double> result;
|
||||
|
||||
if (mag == 0.) {
|
||||
result._M_re = result._M_im = 0.;
|
||||
} else if (re > 0.) {
|
||||
result._M_re = _STLP_SQRT(0.5 * (mag + re));
|
||||
result._M_im = im/result._M_re/2;
|
||||
} else {
|
||||
result._M_im = _STLP_SQRT(0.5 * (mag - re));
|
||||
if (im < 0.)
|
||||
result._M_im = - result._M_im;
|
||||
result._M_re = im/result._M_im/2;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
complex<long double> _STLP_CALL
|
||||
sqrt(const complex<long double>& z) {
|
||||
long double re = z._M_re;
|
||||
long double im = z._M_im;
|
||||
long double mag = _STLP_HYPOTL(re, im);
|
||||
complex<long double> result;
|
||||
|
||||
if (mag == 0.L) {
|
||||
result._M_re = result._M_im = 0.L;
|
||||
} else if (re > 0.L) {
|
||||
result._M_re = _STLP_SQRTL(0.5L * (mag + re));
|
||||
result._M_im = (im/result._M_re) * .5L;
|
||||
} else {
|
||||
result._M_im = _STLP_SQRTL(0.5L * (mag - re));
|
||||
if (im < 0.L)
|
||||
result._M_im = - result._M_im;
|
||||
result._M_re = (im/result._M_im) * .5L;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
239
STLPORT/src/complex_exp.cpp
Normal file
239
STLPORT/src/complex_exp.cpp
Normal file
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
// exp, log, pow for complex<float>, complex<double>, and complex<long double>
|
||||
|
||||
#include <numeric>
|
||||
#include "complex_impl.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// exp
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL
|
||||
exp(const complex<float>& z)
|
||||
{
|
||||
float expx = _STLP_EXPF(z._M_re);
|
||||
return complex<float>(expx * _STLP_COSF(z._M_im),
|
||||
expx * _STLP_SINF(z._M_im));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL exp(const complex<double>& z)
|
||||
{
|
||||
double expx = _STLP_EXP(z._M_re);
|
||||
return complex<double>(expx * _STLP_COS(z._M_im),
|
||||
expx * _STLP_SIN(z._M_im));
|
||||
}
|
||||
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL exp(const complex<long double>& z)
|
||||
{
|
||||
long double expx = _STLP_EXPL(z._M_re);
|
||||
return complex<long double>(expx * _STLP_COSL(z._M_im),
|
||||
expx * _STLP_SINL(z._M_im));
|
||||
}
|
||||
# endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// log10
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL log10(const complex<float>& z)
|
||||
{
|
||||
complex<float> r;
|
||||
static float ln10_inv = 1.f / _STLP_LOGF(10.f);
|
||||
|
||||
r._M_im = _STLP_ATAN2F(z._M_im, z._M_re) * ln10_inv;
|
||||
r._M_re = _STLP_LOG10F(_STLP_HYPOTF(z._M_re, z._M_im));
|
||||
return r;
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL log10(const complex<double>& z)
|
||||
{
|
||||
complex<double> r;
|
||||
static double ln10_inv = 1. / _STLP_LOG(10.);
|
||||
|
||||
r._M_im = _STLP_ATAN2(z._M_im, z._M_re) * ln10_inv;
|
||||
r._M_re = _STLP_LOG10(_STLP_HYPOT(z._M_re, z._M_im));
|
||||
return r;
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL log10(const complex<long double>& z)
|
||||
{
|
||||
complex<long double> result;
|
||||
static long double ln10_inv = 1.l / _STLP_LOGL(10.l);
|
||||
|
||||
result._M_im = _STLP_ATAN2L(z._M_im, z._M_re) * ln10_inv;
|
||||
result._M_re = _STLP_LOG10L(_STLP_HYPOTL(z._M_re, z._M_im));
|
||||
return result;
|
||||
}
|
||||
# endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// log
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL log(const complex<float>& z)
|
||||
{
|
||||
complex<float> r;
|
||||
|
||||
r._M_im = _STLP_ATAN2F(z._M_im, z._M_re);
|
||||
r._M_re = _STLP_LOGF(_STLP_HYPOTF(z._M_re, z._M_im));
|
||||
return r;
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL log(const complex<double>& z)
|
||||
{
|
||||
complex<double> r;
|
||||
|
||||
r._M_im = _STLP_ATAN2(z._M_im, z._M_re);
|
||||
r._M_re = _STLP_LOG(_STLP_HYPOT(z._M_re, z._M_im));
|
||||
return r;
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL log(const complex<long double>& z)
|
||||
{
|
||||
complex<long double> result;
|
||||
|
||||
result._M_im = _STLP_ATAN2L(z._M_im, z._M_re);
|
||||
result._M_re = _STLP_LOGL(_STLP_HYPOTL(z._M_re, z._M_im));
|
||||
return result;
|
||||
}
|
||||
# endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// pow
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL pow(const float& a, const complex<float>& b) {
|
||||
float logr = _STLP_LOGF(a);
|
||||
float x = _STLP_EXPF(logr*b._M_re);
|
||||
float y = logr*b._M_im;
|
||||
|
||||
return complex<float>(x * _STLP_COSF(y), x * _STLP_SINF(y));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL pow(const complex<float>& z_in, int n) {
|
||||
complex<float> z = z_in;
|
||||
z = __power(z, (n < 0 ? -n : n), multiplies< complex<float> >());
|
||||
if (n < 0)
|
||||
return 1.f / z;
|
||||
else
|
||||
return z;
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL pow(const complex<float>& a, const float& b) {
|
||||
float logr = _STLP_LOGF(_STLP_HYPOTF(a._M_re,a._M_im));
|
||||
float logi = _STLP_ATAN2F(a._M_im, a._M_re);
|
||||
float x = _STLP_EXPF(logr * b);
|
||||
float y = logi * b;
|
||||
|
||||
return complex<float>(x * _STLP_COSF(y), x * _STLP_SINF(y));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL pow(const complex<float>& a, const complex<float>& b) {
|
||||
float logr = _STLP_LOGF(_STLP_HYPOTF(a._M_re,a._M_im));
|
||||
float logi = _STLP_ATAN2F(a._M_im, a._M_re);
|
||||
float x = _STLP_EXPF(logr*b._M_re - logi*b._M_im);
|
||||
float y = logr*b._M_im + logi*b._M_re;
|
||||
|
||||
return complex<float>(x * _STLP_COSF(y), x * _STLP_SINF(y));
|
||||
}
|
||||
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL pow(const double& a, const complex<double>& b) {
|
||||
double logr = _STLP_LOG(a);
|
||||
double x = _STLP_EXP(logr*b._M_re);
|
||||
double y = logr*b._M_im;
|
||||
|
||||
return complex<double>(x * _STLP_COS(y), x * _STLP_SIN(y));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL pow(const complex<double>& z_in, int n) {
|
||||
complex<double> z = z_in;
|
||||
z = __power(z, (n < 0 ? -n : n), multiplies< complex<double> >());
|
||||
if (n < 0)
|
||||
#if !defined(__SC__) //*TY 04/15/2000 -
|
||||
return 1. / z;
|
||||
#else //*TY 04/15/2000 - added workaround for SCpp compiler
|
||||
return double(1.0) / z; //*TY 04/15/2000 - it incorrectly assign long double attribute to floating point literals
|
||||
#endif //*TY 04/15/2000 -
|
||||
else
|
||||
return z;
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL pow(const complex<double>& a, const double& b) {
|
||||
double logr = _STLP_LOG(_STLP_HYPOT(a._M_re,a._M_im));
|
||||
double logi = _STLP_ATAN2(a._M_im, a._M_re);
|
||||
double x = _STLP_EXP(logr * b);
|
||||
double y = logi * b;
|
||||
|
||||
return complex<double>(x * _STLP_COS(y), x * _STLP_SIN(y));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL pow(const complex<double>& a, const complex<double>& b) {
|
||||
double logr = _STLP_LOG(_STLP_HYPOT(a._M_re,a._M_im));
|
||||
double logi = _STLP_ATAN2(a._M_im, a._M_re);
|
||||
double x = _STLP_EXP(logr*b._M_re - logi*b._M_im);
|
||||
double y = logr*b._M_im + logi*b._M_re;
|
||||
|
||||
return complex<double>(x * _STLP_COS(y), x * _STLP_SIN(y));
|
||||
}
|
||||
|
||||
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL pow(const long double& a,
|
||||
const complex<long double>& b) {
|
||||
long double logr = _STLP_LOGL(a);
|
||||
long double x = _STLP_EXPL(logr*b._M_re);
|
||||
long double y = logr*b._M_im;
|
||||
|
||||
return complex<long double>(x * _STLP_COSL(y), x * _STLP_SINL(y));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL pow(const complex<long double>& z_in, int n) {
|
||||
complex<long double> z = z_in;
|
||||
z = __power(z, (n < 0 ? -n : n), multiplies< complex<long double> >());
|
||||
if (n < 0)
|
||||
return 1.l / z;
|
||||
else
|
||||
return z;
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL pow(const complex<long double>& a,
|
||||
const long double& b) {
|
||||
long double logr = _STLP_LOGL(_STLP_HYPOTL(a._M_re,a._M_im));
|
||||
long double logi = _STLP_ATAN2L(a._M_im, a._M_re);
|
||||
long double x = _STLP_EXPL(logr * b);
|
||||
long double y = logi * b;
|
||||
|
||||
return complex<long double>(x * _STLP_COSL(y), x * _STLP_SINL(y));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL pow(const complex<long double>& a,
|
||||
const complex<long double>& b) {
|
||||
long double logr = _STLP_LOGL(_STLP_HYPOTL(a._M_re,a._M_im));
|
||||
long double logi = _STLP_ATAN2L(a._M_im, a._M_re);
|
||||
long double x = _STLP_EXPL(logr*b._M_re - logi*b._M_im);
|
||||
long double y = logr*b._M_im + logi*b._M_re;
|
||||
|
||||
return complex<long double>(x * _STLP_COSL(y), x * _STLP_SINL(y));
|
||||
}
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
94
STLPORT/src/complex_impl.h
Normal file
94
STLPORT/src/complex_impl.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# ifndef COMPLEX_IMPL_H
|
||||
# define COMPLEX_IMPL_H
|
||||
|
||||
#include <complex>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
#include <stl/_cmath.h>
|
||||
|
||||
# if (defined (__sgi) && !defined(__GNUC__)) /* || defined (__DECCXX) */
|
||||
|
||||
# define _STLP_ABSF _STLP_VENDOR_CSTD::fabsf
|
||||
# define _STLP_ATAN2F _STLP_VENDOR_CSTD::atan2f
|
||||
# define _STLP_SINF _STLP_VENDOR_CSTD::sinf
|
||||
# define _STLP_COSF _STLP_VENDOR_CSTD::cosf
|
||||
# define _STLP_SQRTF _STLP_VENDOR_CSTD::sqrtf
|
||||
# define _STLP_EXPF _STLP_VENDOR_CSTD::expf
|
||||
# define _STLP_LOG10F _STLP_VENDOR_CSTD::log10f
|
||||
# define _STLP_LOGF _STLP_VENDOR_CSTD::logf
|
||||
# define _STLP_SINHF _STLP_VENDOR_CSTD::sinhf
|
||||
# define _STLP_COSHF _STLP_VENDOR_CSTD::coshf
|
||||
# define _STLP_HYPOTF _STLP_VENDOR_CSTD::hypotf
|
||||
|
||||
|
||||
# define _STLP_ABSL _STLP_VENDOR_CSTD::fabsl
|
||||
# define _STLP_ATAN2L _STLP_VENDOR_CSTD::atan2l
|
||||
# define _STLP_SINL _STLP_VENDOR_CSTD::sinl
|
||||
# define _STLP_COSL _STLP_VENDOR_CSTD::cosl
|
||||
# define _STLP_SQRTL _STLP_VENDOR_CSTD::sqrtl
|
||||
# define _STLP_EXPL _STLP_VENDOR_CSTD::expl
|
||||
# define _STLP_LOG10L _STLP_VENDOR_CSTD::log10l
|
||||
# define _STLP_LOGL _STLP_VENDOR_CSTD::logl
|
||||
# define _STLP_SINHL _STLP_VENDOR_CSTD::sinhl
|
||||
# define _STLP_COSHL _STLP_VENDOR_CSTD::coshl
|
||||
// # define _STLP_HYPOT ::hypot
|
||||
# define _STLP_HYPOTL _STLP_VENDOR_CSTD::hypotl
|
||||
|
||||
#else
|
||||
|
||||
# define _STLP_ABSF (float)_STLP_DO_ABS(double)
|
||||
# define _STLP_ABSL (long double)_STLP_DO_ABS(double)
|
||||
# define _STLP_ATAN2F (float)_STLP_DO_ATAN2(double)
|
||||
# define _STLP_ATAN2L (long double)_STLP_DO_ATAN2(double)
|
||||
# define _STLP_SINF (float)_STLP_DO_SIN(double)
|
||||
# define _STLP_SINL (long double)_STLP_DO_SIN(double)
|
||||
# define _STLP_COSF (float)_STLP_DO_COS(double)
|
||||
# define _STLP_COSL (long double)_STLP_DO_COS(double)
|
||||
# define _STLP_SQRTF (float)_STLP_DO_SQRT(double)
|
||||
# define _STLP_SQRTL (long double)_STLP_DO_SQRT(double)
|
||||
# define _STLP_EXPF (float)_STLP_DO_EXP(double)
|
||||
# define _STLP_EXPL (long double)_STLP_DO_EXP(double)
|
||||
# define _STLP_LOG10F (float)_STLP_DO_LOG10(double)
|
||||
# define _STLP_LOG10L (long double)_STLP_DO_LOG10(double)
|
||||
# define _STLP_LOGF (float)_STLP_DO_LOG(double)
|
||||
# define _STLP_LOGL (long double)_STLP_DO_LOG(double)
|
||||
# define _STLP_SINHF (float)_STLP_DO_SINH(double)
|
||||
# define _STLP_SINHL (long double)_STLP_DO_SINH(double)
|
||||
# define _STLP_COSHF (float)_STLP_DO_COSH(double)
|
||||
# define _STLP_COSHL (long double)_STLP_DO_COSH(double)
|
||||
# define _STLP_HYPOTF (float)_STLP_DO_HYPOT(double)
|
||||
# define _STLP_HYPOTL (long double)_STLP_DO_HYPOT(double)
|
||||
|
||||
#endif
|
||||
|
||||
# define _STLP_ABS (double)_STLP_DO_ABS(double)
|
||||
# define _STLP_ATAN2 (double)_STLP_DO_ATAN2(double)
|
||||
# define _STLP_SIN (double)_STLP_DO_SIN(double)
|
||||
# define _STLP_COS (double)_STLP_DO_COS(double)
|
||||
# define _STLP_SQRT (double)_STLP_DO_SQRT(double)
|
||||
# define _STLP_EXP (double)_STLP_DO_EXP(double)
|
||||
# define _STLP_LOG10 (double)_STLP_DO_LOG10(double)
|
||||
# define _STLP_LOG (double)_STLP_DO_LOG(double)
|
||||
# define _STLP_SINH (double)_STLP_DO_SINH(double)
|
||||
# define _STLP_COSH (double)_STLP_DO_COSH(double)
|
||||
# define _STLP_HYPOT _STLP_DO_HYPOT(double)
|
||||
|
||||
#endif
|
||||
144
STLPORT/src/complex_io.cpp
Normal file
144
STLPORT/src/complex_io.cpp
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
// #include <iterator>
|
||||
#include "complex_impl.h"
|
||||
#include <istream>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
# if ! (defined (_STLP_MSVC) && _STLP_MSVC < 1200)
|
||||
|
||||
// Specializations for narrow characters; lets us avoid the nuisance of
|
||||
// widening.
|
||||
_STLP_OPERATOR_SPEC
|
||||
basic_ostream<char, char_traits<char> >& _STLP_CALL
|
||||
operator<< (basic_ostream<char, char_traits<char> >& __os, const complex<float>& __z)
|
||||
{
|
||||
return __os << '(' << (double)__z.real() << ',' << (double)__z.imag() << ')';
|
||||
}
|
||||
|
||||
_STLP_OPERATOR_SPEC
|
||||
basic_ostream<char, char_traits<char> >& _STLP_CALL
|
||||
operator<< (basic_ostream<char, char_traits<char> >& __os, const complex<double>& __z)
|
||||
{
|
||||
return __os << '(' << __z.real() << ',' << __z.imag() << ')';
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_OPERATOR_SPEC
|
||||
basic_ostream<char, char_traits<char> >& _STLP_CALL
|
||||
operator<< (basic_ostream<char, char_traits<char> >& __os, const complex<long double>& __z)
|
||||
{
|
||||
return __os << '(' << __z.real() << ',' << __z.imag() << ')';
|
||||
}
|
||||
#endif
|
||||
|
||||
// Specialization for narrow characters; lets us avoid widen.
|
||||
_STLP_OPERATOR_SPEC
|
||||
basic_istream<char, char_traits<char> >& _STLP_CALL
|
||||
operator>>(basic_istream<char, char_traits<char> >& __is, complex<float>& __z)
|
||||
{
|
||||
float __re = 0;
|
||||
float __im = 0;
|
||||
|
||||
char __c;
|
||||
|
||||
__is >> __c;
|
||||
if (__c == '(') {
|
||||
__is >> __re >> __c;
|
||||
if (__c == ',')
|
||||
__is >> __im >> __c;
|
||||
if (__c != ')')
|
||||
__is.setstate(ios_base::failbit);
|
||||
}
|
||||
else {
|
||||
__is.putback(__c);
|
||||
__is >> __re;
|
||||
}
|
||||
|
||||
if (__is)
|
||||
__z = complex<float>(__re, __im);
|
||||
return __is;
|
||||
}
|
||||
|
||||
_STLP_OPERATOR_SPEC
|
||||
basic_istream<char, char_traits<char> >& _STLP_CALL
|
||||
operator>>(basic_istream<char, char_traits<char> >& __is, complex<double>& __z)
|
||||
{
|
||||
double __re = 0;
|
||||
double __im = 0;
|
||||
|
||||
char __c;
|
||||
|
||||
__is >> __c;
|
||||
if (__c == '(') {
|
||||
__is >> __re >> __c;
|
||||
if (__c == ',')
|
||||
__is >> __im >> __c;
|
||||
if (__c != ')')
|
||||
__is.setstate(ios_base::failbit);
|
||||
}
|
||||
else {
|
||||
__is.putback(__c);
|
||||
__is >> __re;
|
||||
}
|
||||
|
||||
if (__is)
|
||||
__z = complex<double>(__re, __im);
|
||||
return __is;
|
||||
}
|
||||
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_OPERATOR_SPEC
|
||||
basic_istream<char, char_traits<char> >& _STLP_CALL
|
||||
operator>>(basic_istream<char, char_traits<char> >& __is, complex<long double>& __z) {
|
||||
long double __re = 0;
|
||||
long double __im = 0;
|
||||
|
||||
char __c;
|
||||
|
||||
__is >> __c;
|
||||
if (__c == '(') {
|
||||
__is >> __re >> __c;
|
||||
if (__c == ',')
|
||||
__is >> __im >> __c;
|
||||
if (__c != ')')
|
||||
__is.setstate(ios_base::failbit);
|
||||
}
|
||||
else {
|
||||
__is.putback(__c);
|
||||
__is >> __re;
|
||||
}
|
||||
|
||||
if (__is)
|
||||
__z = complex<long double>(__re, __im);
|
||||
return __is;
|
||||
}
|
||||
# endif
|
||||
|
||||
# endif /* MSVC */
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
57
STLPORT/src/complex_io_w.cpp
Normal file
57
STLPORT/src/complex_io_w.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
// #include <iterator>
|
||||
#include <complex>
|
||||
#include <istream>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
// Force instantiation of complex I/O functions
|
||||
|
||||
#if !(defined (_STLP_NO_FORCE_INSTANTIATE) || defined (_STLP_NO_WCHAR_T))
|
||||
|
||||
_STLP_OPERATOR_SPEC basic_istream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
|
||||
operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&, complex<float>&);
|
||||
|
||||
_STLP_OPERATOR_SPEC basic_istream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
|
||||
operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&, complex<double>&);
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_OPERATOR_SPEC basic_istream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
|
||||
operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&, complex<long double>&);
|
||||
|
||||
_STLP_OPERATOR_SPEC basic_ostream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
|
||||
operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<long double>&);
|
||||
#endif
|
||||
|
||||
_STLP_OPERATOR_SPEC basic_ostream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
|
||||
operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<float>&);
|
||||
|
||||
_STLP_OPERATOR_SPEC basic_ostream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
|
||||
operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<double>&);
|
||||
|
||||
# endif /* _STLP_NO_WCHAR_T */
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
218
STLPORT/src/complex_trig.cpp
Normal file
218
STLPORT/src/complex_trig.cpp
Normal file
@@ -0,0 +1,218 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
|
||||
// Trigonometric and hyperbolic functions for complex<float>,
|
||||
// complex<double>, and complex<long double>
|
||||
|
||||
|
||||
#include "complex_impl.h"
|
||||
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// helpers
|
||||
|
||||
#ifdef __sgi
|
||||
static const union { unsigned int i; float f; } float_ulimit = { 0x42b2d4fc };
|
||||
static const float float_limit = float_ulimit.f;
|
||||
static union {
|
||||
struct { unsigned int h; unsigned int l; } w;
|
||||
double d;
|
||||
} double_ulimit = { 0x408633ce, 0x8fb9f87d };
|
||||
static const double double_limit = double_ulimit.d;
|
||||
static union {
|
||||
struct { unsigned int h[2]; unsigned int l[2]; } w;
|
||||
long double ld;
|
||||
} ldouble_ulimit = {0x408633ce, 0x8fb9f87e, 0xbd23b659, 0x4e9bd8b1};
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
static const long double ldouble_limit = ldouble_ulimit.ld;
|
||||
# endif
|
||||
#else
|
||||
static const float float_limit = _STLP_LOGF(FLT_MAX);
|
||||
static const double double_limit = _STLP_DO_LOG(double)(DBL_MAX);
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
static const long double ldouble_limit = _STLP_LOGL(LDBL_MAX);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// sin
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL sin(const complex<float>& z) {
|
||||
return complex<float>(_STLP_SINF(z._M_re) * _STLP_COSHF(z._M_im),
|
||||
_STLP_COSF(z._M_re) * _STLP_SINHF(z._M_im));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL sin(const complex<double>& z) {
|
||||
return complex<double>(_STLP_SIN(z._M_re) * _STLP_COSH(z._M_im),
|
||||
_STLP_COS(z._M_re) * _STLP_SINH(z._M_im));
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL sin(const complex<long double>& z) {
|
||||
return complex<long double>(_STLP_SINL(z._M_re) * _STLP_COSHL(z._M_im),
|
||||
_STLP_COSL(z._M_re) * _STLP_SINHL(z._M_im));
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// cos
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL cos(const complex<float>& z) {
|
||||
return complex<float>(_STLP_COSF(z._M_re) * _STLP_COSHF(z._M_im),
|
||||
-_STLP_SINF(z._M_re) * _STLP_SINHF(z._M_im));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL cos(const complex<double>& z) {
|
||||
return complex<double>(_STLP_COS(z._M_re) * _STLP_COSH(z._M_im),
|
||||
-_STLP_SIN(z._M_re) * _STLP_SINH(z._M_im));
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL cos(const complex<long double>& z) {
|
||||
return complex<long double>(_STLP_COSL(z._M_re) * _STLP_COSHL(z._M_im),
|
||||
-_STLP_SINL(z._M_re) * _STLP_SINHL(z._M_im));
|
||||
}
|
||||
# endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// tan
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL tan(const complex<float>& z) {
|
||||
float re2 = 2.f * z._M_re;
|
||||
float im2 = 2.f * z._M_im;
|
||||
|
||||
if (_STLP_ABSF(im2) > float_limit)
|
||||
return complex<float>(0.f, (im2 > 0 ? 1.f : -1.f));
|
||||
else {
|
||||
float den = _STLP_COSF(re2) + _STLP_COSHF(im2);
|
||||
return complex<float>(_STLP_SINF(re2) / den, _STLP_SINHF(im2) / den);
|
||||
}
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL tan(const complex<double>& z) {
|
||||
double re2 = 2. * z._M_re;
|
||||
double im2 = 2. * z._M_im;
|
||||
|
||||
if (fabs(float(im2)) > double_limit)
|
||||
return complex<double>(0., (im2 > 0 ? 1. : -1.));
|
||||
else {
|
||||
double den = _STLP_COS(re2) + _STLP_COSH(im2);
|
||||
return complex<double>(_STLP_SIN(re2) / den, _STLP_SINH(im2) / den);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL tan(const complex<long double>& z) {
|
||||
long double re2 = 2.l * z._M_re;
|
||||
long double im2 = 2.l * z._M_im;
|
||||
if (_STLP_ABSL(im2) > ldouble_limit)
|
||||
return complex<long double>(0.l, (im2 > 0 ? 1.l : -1.l));
|
||||
else {
|
||||
long double den = _STLP_COSL(re2) + _STLP_COSHL(im2);
|
||||
return complex<long double>(_STLP_SINL(re2) / den, _STLP_SINHL(im2) / den);
|
||||
}
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// sinh
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL sinh(const complex<float>& z) {
|
||||
return complex<float>(_STLP_SINHF(z._M_re) * _STLP_COSF(z._M_im),
|
||||
_STLP_COSHF(z._M_re) * _STLP_SINF(z._M_im));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL sinh(const complex<double>& z) {
|
||||
return complex<double>(_STLP_SINH(z._M_re) * _STLP_COS(z._M_im),
|
||||
_STLP_COSH(z._M_re) * _STLP_SIN(z._M_im));
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL sinh(const complex<long double>& z) {
|
||||
return complex<long double>(_STLP_SINHL(z._M_re) * _STLP_COSL(z._M_im),
|
||||
_STLP_COSHL(z._M_re) * _STLP_SINL(z._M_im));
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// cosh
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL cosh(const complex<float>& z) {
|
||||
return complex<float>(_STLP_COSHF(z._M_re) * _STLP_COSF(z._M_im),
|
||||
_STLP_SINHF(z._M_re) * _STLP_SINF(z._M_im));
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL cosh(const complex<double>& z) {
|
||||
return complex<double>(_STLP_COSH(z._M_re) * _STLP_COS(z._M_im),
|
||||
_STLP_SINH(z._M_re) * _STLP_SIN(z._M_im));
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL cosh(const complex<long double>& z) {
|
||||
return complex<long double>(_STLP_COSHL(z._M_re) * _STLP_COSL(z._M_im),
|
||||
_STLP_SINHL(z._M_re) * _STLP_SINL(z._M_im));
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// tanh
|
||||
|
||||
_STLP_DECLSPEC complex<float> _STLP_CALL tanh(const complex<float>& z) {
|
||||
float re2 = 2.f * z._M_re;
|
||||
float im2 = 2.f * z._M_im;
|
||||
if (_STLP_ABSF(re2) > float_limit)
|
||||
return complex<float>((re2 > 0 ? 1.f : -1.f), 0.f);
|
||||
else {
|
||||
float den = _STLP_COSHF(re2) + _STLP_COSF(im2);
|
||||
return complex<float>(_STLP_SINHF(re2) / den, _STLP_SINF(im2) / den);
|
||||
}
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC complex<double> _STLP_CALL tanh(const complex<double>& z) {
|
||||
double re2 = 2. * z._M_re;
|
||||
double im2 = 2. * z._M_im;
|
||||
if (fabs(float(re2)) > double_limit)
|
||||
return complex<double>((re2 > 0 ? 1. : -1.), 0.);
|
||||
else {
|
||||
double den = _STLP_COSH(re2) + _STLP_COS(im2);
|
||||
return complex<double>(_STLP_SINH(re2) / den, _STLP_SIN(im2) / den);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
_STLP_DECLSPEC complex<long double> _STLP_CALL tanh(const complex<long double>& z) {
|
||||
long double re2 = 2.l * z._M_re;
|
||||
long double im2 = 2.l * z._M_im;
|
||||
if (_STLP_ABSL(re2) > ldouble_limit)
|
||||
return complex<long double>((re2 > 0 ? 1.l : -1.l), 0.l);
|
||||
else {
|
||||
long double den = _STLP_COSHL(re2) + _STLP_COSL(im2);
|
||||
return complex<long double>(_STLP_SINHL(re2) / den, _STLP_SINL(im2) / den);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
_STLP_END_NAMESPACE
|
||||
155
STLPORT/src/cray.mak
Normal file
155
STLPORT/src/cray.mak
Normal file
@@ -0,0 +1,155 @@
|
||||
#
|
||||
# Note : This makefile is for Cray C++ 3.4 and 3.5
|
||||
#
|
||||
# The GNU version of make must be used to execute the
|
||||
# makefile. The UNICOS version of make does not support
|
||||
# the "%.suffix1: %.suffix2" feature.
|
||||
#
|
||||
# GNU version of make is available from the Cray Open
|
||||
# Source release, or can be downloaded from various of
|
||||
# open source sites.
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = cc
|
||||
CXX = CC
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
|
||||
OBJEXT=o
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=CRAY$(ARCH)
|
||||
|
||||
all: all_static all_staticx
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR}
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -D_STLP_HAS_NO_EXCEPTIONS
|
||||
CXXFLAGS_RELEASE_staticx = $(CXXFLAGS_COMMON) -hexceptions
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -g
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG -D_STLP_HAS_NO_EXCEPTIONS
|
||||
CXXFLAGS_STLDEBUG_staticx = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG -hexceptions
|
||||
|
||||
include common_percent_rules.mak
|
||||
|
||||
# common_percent_rules.mak does not contain makerules for staticx source
|
||||
$(RELEASE_OBJDIR_staticx)/%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS_RELEASE_staticx) $< -c -o $@
|
||||
$(RELEASE_OBJDIR_staticx)/%.o: %.c
|
||||
$(CC) $(CXXFLAGS_RELEASE_staticx) $< -c -o $@
|
||||
$(RELEASE_OBJDIR_staticx)/%.i : %.cpp
|
||||
$(CXX) $(CXXFLAGS_RELEASE_staticx) $< -E $@
|
||||
|
||||
$(STLDEBUG_OBJDIR_staticx)/%.o : %.cpp
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_staticx) $< -c -o $@
|
||||
$(STLDEBUG_OBJDIR_staticx)/%.o : %.c
|
||||
$(CC) $(CXXFLAGS_STLDEBUG_staticx) $< -c -o $@
|
||||
$(STLDEBUG_OBJDIR_staticx)/%.i : %.cpp
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_staticx) $< -E $@
|
||||
|
||||
#include common_rules.mak
|
||||
#
|
||||
# Target directories
|
||||
#
|
||||
#
|
||||
|
||||
$(OUTDIR) :
|
||||
$(MKDIR) $(OUTDIR)
|
||||
$(RELEASE_OBJDIR_static) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_static)
|
||||
$(DEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_static)
|
||||
$(STLDEBUG_OBJDIR_static) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_static)
|
||||
$(RELEASE_OBJDIR_staticx) :
|
||||
$(MKDIR) $(RELEASE_OBJDIR_staticx)
|
||||
$(DEBUG_OBJDIR_staticx) :
|
||||
$(MKDIR) $(DEBUG_OBJDIR_staticx)
|
||||
$(STLDEBUG_OBJDIR_staticx) :
|
||||
$(MKDIR) $(STLDEBUG_OBJDIR_staticx)
|
||||
|
||||
#create a compiler platform directory
|
||||
platform: $(PREPARE_STEP)
|
||||
-@$(MKDIR) $(OUTDIR)
|
||||
-@$(MKDIR) $(OBJDIR_COMMON)
|
||||
-@$(MKDIR) $(OBJDIR)
|
||||
|
||||
clean_all_obj:
|
||||
-$(RM) $(OUTDIR)$(PATH_SEP)obj
|
||||
|
||||
###### Targets ##################
|
||||
|
||||
all_static : platform $(ALL_STATIC_LIBS)
|
||||
|
||||
all_staticx : platform $(ALL_STATICX_LIBS)
|
||||
|
||||
release_static : platform $(OUTDIR)$(PATH_SEP)$(RELEASE_LIB)
|
||||
|
||||
debug_static : platform $(OUTDIR)$(PATH_SEP)$(DEBUG_LIB)
|
||||
|
||||
stldebug_static : platform $(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB)
|
||||
|
||||
release_staticx : platform $(OUTDIR)$(PATH_SEP)$(RELEASEX_LIB)
|
||||
|
||||
debug_staticx : platform $(OUTDIR)$(PATH_SEP)$(DEBUGX_LIB)
|
||||
|
||||
stldebug_staticx : platform $(OUTDIR)$(PATH_SEP)$(STLDEBUGX_LIB)
|
||||
|
||||
install : all $(INSTALL_STEP)
|
||||
|
||||
clean : $(CLEAN_SPECIFIC)
|
||||
-$(RM) $(RELEASE_OBJDIR_static) $(DEBUG_OBJDIR_static) $(STLDEBUG_OBJDIR_static) \
|
||||
$(RELEASE_OBJDIR_staticx) $(DEBUG_OBJDIR_staticx) $(STLDEBUG_OBJDIR_staticx)
|
||||
|
||||
clobber : clean clean_all_obj
|
||||
-$(RM) $(OUTDIR)$(PATH_SEP)$(DEBUG_NAME).* \
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_NAME).* $(OUTDIR)$(PATH_SEP)$(STLDEBUG_NAME).*
|
||||
|
||||
# Need to link with a dummy main process to fully instantiate object files.
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) : $(OUTDIR) $(RELEASE_OBJDIR_static) $(DEF_FILE) $(RELEASE_OBJECTS_static)
|
||||
echo 'main() { }' >dummy_main.C
|
||||
$(CXX) -o junk dummy_main.C $(RELEASE_OBJECTS_static) -lpthread
|
||||
rm dummy_main.C
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) $(LDFLAGS_RELEASE_static) $(RELEASE_OBJECTS_static) $(LDLIBS_RELEASE_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASEX_LIB) : $(OUTDIR) $(RELEASE_OBJDIR_staticx) $(DEF_FILE) $(RELEASE_OBJECTS_staticx)
|
||||
echo 'main() { }' >dummy_main.C
|
||||
$(CXX) -o junk dummy_main.C $(RELEASE_OBJECTS_staticx) -lpthread
|
||||
rm dummy_main.C
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(RELEASEX_LIB) $(LDFLAGS_RELEASE_static) $(RELEASE_OBJECTS_staticx) $(LDLIBS_RELEASE_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) : $(OUTDIR) $(STLDEBUG_OBJDIR_static) $(DEF_FILE) $(STLDEBUG_OBJECTS_static)
|
||||
echo 'main() { }' >dummy_main.C
|
||||
$(CXX) -o junk dummy_main.C $(STLDEBUG_OBJECTS_static) -lpthread
|
||||
rm dummy_main.C
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUG_LIB) $(LDFLAGS_STLDEBUG_static) $(STLDEBUG_OBJECTS_static) $(LDLIBS_STLDEBUG_static)
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(STLDEBUGX_LIB) : $(OUTDIR) $(STLDEBUG_OBJDIR_staticx) $(DEF_FILE) $(STLDEBUG_OBJECTS_staticx)
|
||||
echo 'main() { }' >dummy_main.C
|
||||
$(CXX) -o junk dummy_main.C $(STLDEBUG_OBJECTS_staticx) -lpthread
|
||||
rm dummy_main.C
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(STLDEBUGX_LIB) $(LDFLAGS_STLDEBUG_static) $(STLDEBUG_OBJECTS_staticx) $(LDLIBS_STLDEBUG_static)
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
%.s: %.cpp
|
||||
$(CXX) $(CXXFLAGS) -S $< -o $@
|
||||
|
||||
|
||||
490
STLPORT/src/ctype.cpp
Normal file
490
STLPORT/src/ctype.cpp
Normal file
@@ -0,0 +1,490 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <stl/_ctype.h>
|
||||
#include <stl/_function.h>
|
||||
#include "c_locale.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ctype<char>
|
||||
|
||||
// The classic table: static data members.
|
||||
|
||||
# if !defined(_STLP_STATIC_CONST_INIT_BUG) && !(defined(__MRC__) || defined(__SC__))
|
||||
//*TY 02/25/2000 - added workaround for MPW compilers; they confuse on in-class static const
|
||||
const size_t ctype<char>::table_size;
|
||||
# endif
|
||||
|
||||
// This macro is specifically for platforms where isprint() relies
|
||||
// on separate flag
|
||||
|
||||
# define PRINTFLAG ctype_base::mask( _Locale_PRINT & ~(_Locale_UPPER | _Locale_LOWER | _Locale_ALPHA | _Locale_DIGIT | _Locale_PUNCT | _Locale_SPACE | _Locale_XDIGIT ))
|
||||
|
||||
// Ctype table for the ASCII character set.
|
||||
// There are 257 entries in this table. The first is EOF (-1).
|
||||
// That is, the "table" seen by ctype<char> member functions is
|
||||
// _S_classic_table + 1.
|
||||
const ctype_base::mask
|
||||
ctype<char>::_S_classic_table[257] =
|
||||
{
|
||||
ctype_base::mask(0) /* EOF */,
|
||||
cntrl /* null */,
|
||||
cntrl /* ^A */,
|
||||
cntrl /* ^B */,
|
||||
cntrl /* ^C */,
|
||||
cntrl /* ^D */,
|
||||
cntrl /* ^E */,
|
||||
cntrl /* ^F */,
|
||||
cntrl /* ^G */,
|
||||
cntrl /* ^H */,
|
||||
ctype_base::mask(space | cntrl) /* tab */,
|
||||
ctype_base::mask(space | cntrl) /* LF */,
|
||||
ctype_base::mask(space | cntrl) /* ^K */,
|
||||
ctype_base::mask(space | cntrl) /* FF */,
|
||||
ctype_base::mask(space | cntrl) /* ^M */,
|
||||
cntrl /* ^N */,
|
||||
cntrl /* ^O */,
|
||||
cntrl /* ^P */,
|
||||
cntrl /* ^Q */,
|
||||
cntrl /* ^R */,
|
||||
cntrl /* ^S */,
|
||||
cntrl /* ^T */,
|
||||
cntrl /* ^U */,
|
||||
cntrl /* ^V */,
|
||||
cntrl /* ^W */,
|
||||
cntrl /* ^X */,
|
||||
cntrl /* ^Y */,
|
||||
cntrl /* ^Z */,
|
||||
cntrl /* esc */,
|
||||
cntrl /* ^\ */,
|
||||
cntrl /* ^] */,
|
||||
cntrl /* ^^ */,
|
||||
cntrl /* ^_ */,
|
||||
ctype_base::mask (space | PRINTFLAG) /* */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ! */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* " */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* # */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* $ */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* % */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* & */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ' */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ( */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ) */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* * */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* + */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* , */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* - */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* . */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* / */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 0 */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 1 */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 2 */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 3 */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 4 */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 5 */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 6 */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 7 */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 8 */,
|
||||
ctype_base::mask(digit | PRINTFLAG | xdigit) /* 9 */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* : */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ; */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* < */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* = */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* > */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ? */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ! */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper | xdigit) /* A */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper | xdigit) /* B */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper | xdigit) /* C */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper | xdigit) /* D */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper | xdigit) /* E */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper | xdigit) /* F */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* G */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* H */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* I */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* J */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* K */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* L */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* M */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* N */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* O */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* P */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* Q */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* R */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* S */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* T */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* U */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* V */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* W */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* X */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* Y */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | upper) /* Z */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* [ */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* \ */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ] */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ^ */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* _ */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ` */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower | xdigit) /* a */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower | xdigit) /* b */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower | xdigit) /* c */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower | xdigit) /* d */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower | xdigit) /* e */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower | xdigit) /* f */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* g */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* h */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* i */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* j */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* k */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* l */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* m */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* n */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* o */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* p */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* q */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* r */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* s */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* t */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* u */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* v */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* w */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* x */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* y */,
|
||||
ctype_base::mask(alpha | PRINTFLAG | lower) /* x */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* { */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* | */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* } */,
|
||||
ctype_base::mask (punct | PRINTFLAG ) /* ~ */,
|
||||
cntrl /* del (0x7f)*/,
|
||||
/* ASCII is a 7-bit code, so everything else is non-ASCII */
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0),
|
||||
ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0), ctype_base::mask(0)
|
||||
};
|
||||
|
||||
// For every c in the range 0 <= c < 256, _S_upper[c] is the
|
||||
// uppercased version of c and _S_lower[c] is the lowercased
|
||||
// version. As before, these two tables assume the ASCII character
|
||||
// set.
|
||||
|
||||
const unsigned char ctype<char>::_S_upper[256] =
|
||||
{
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
|
||||
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
|
||||
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
|
||||
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
|
||||
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
|
||||
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
|
||||
0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
|
||||
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
|
||||
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
|
||||
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
|
||||
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
|
||||
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
|
||||
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
|
||||
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
|
||||
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
|
||||
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
|
||||
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
|
||||
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
|
||||
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
||||
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
|
||||
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
|
||||
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
|
||||
};
|
||||
|
||||
const unsigned char ctype<char>::_S_lower[256] =
|
||||
{
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
|
||||
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
|
||||
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
|
||||
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
|
||||
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
|
||||
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
|
||||
0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
|
||||
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
|
||||
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
|
||||
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
|
||||
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
|
||||
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
|
||||
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
|
||||
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
|
||||
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
|
||||
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
|
||||
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
|
||||
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
|
||||
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
|
||||
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
|
||||
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
||||
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
|
||||
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
|
||||
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
|
||||
};
|
||||
|
||||
|
||||
// Some helper functions used in ctype<>::scan_is and scan_is_not.
|
||||
|
||||
struct _Ctype_is_mask {
|
||||
typedef char argument_type;
|
||||
typedef bool result_type;
|
||||
|
||||
ctype_base::mask _Mask;
|
||||
const ctype_base::mask* _M_table;
|
||||
|
||||
_Ctype_is_mask(ctype_base::mask __m, const ctype_base::mask* __t) : _Mask(__m), _M_table(__t) {}
|
||||
bool operator()(char __c) const { return (_M_table[(unsigned char) __c] & _Mask) != 0; }
|
||||
};
|
||||
|
||||
struct _Ctype_not_mask {
|
||||
typedef char argument_type;
|
||||
typedef bool result_type;
|
||||
|
||||
ctype_base::mask _Mask;
|
||||
const ctype_base::mask* _M_table;
|
||||
|
||||
_Ctype_not_mask(ctype_base::mask __m, const ctype_base::mask* __t) : _Mask(__m), _M_table(__t) {}
|
||||
bool operator()(char __c) const { return (_M_table[(unsigned char) __c] & _Mask) == 0; }
|
||||
};
|
||||
|
||||
ctype<char>::ctype(const ctype_base::mask * __tab, bool __del, size_t __refs) :
|
||||
_BaseFacet(__refs) /* , _M_ctype_table(0) */ {
|
||||
_M_ctype_table = __tab ? __tab : classic_table();
|
||||
_M_delete = __tab && __del;
|
||||
}
|
||||
|
||||
ctype<char>::~ctype() {
|
||||
if (_M_delete)
|
||||
delete[] __CONST_CAST(ctype_base::mask *, _M_ctype_table);
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype<char>::scan_is(ctype_base::mask __m, const char* __low, const char* __high) const {
|
||||
return _STLP_STD::find_if(__low, __high, _Ctype_is_mask(__m, _M_ctype_table));
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype<char>::scan_not(ctype_base::mask __m, const char* __low, const char* __high) const {
|
||||
return _STLP_STD::find_if(__low, __high, _Ctype_not_mask(__m, _M_ctype_table));
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_toupper(char __c) const
|
||||
{ return (char) _S_upper[(unsigned char) __c]; }
|
||||
char
|
||||
ctype<char>::do_tolower(char __c) const
|
||||
{ return (char) _S_lower[(unsigned char) __c]; }
|
||||
const char*
|
||||
ctype<char>::do_toupper(char* __low, const char* __high) const {
|
||||
for ( ; __low < __high; ++__low)
|
||||
*__low = (char) _S_upper[(unsigned char) *__low];
|
||||
return __high;
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype<char>::do_tolower(char* __low, const char* __high) const {
|
||||
for ( ; __low < __high; ++__low)
|
||||
*__low = (char) _S_lower[(unsigned char) *__low];
|
||||
return __high;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<char>::do_widen(char __c) const { return __c; }
|
||||
|
||||
const char*
|
||||
ctype<char>::do_widen(const char* __low, const char* __high,
|
||||
char* __to) const {
|
||||
__copy_trivial(__low, __high, __to);
|
||||
return __high;
|
||||
}
|
||||
char
|
||||
ctype<char>::do_narrow(char __c, char /* dfault */ ) const { return __c; }
|
||||
const char*
|
||||
ctype<char>::do_narrow(const char* __low, const char* __high,
|
||||
char /* dfault */, char* __to) const {
|
||||
__copy_trivial(__low, __high, __to);
|
||||
return __high;
|
||||
}
|
||||
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
struct _Ctype_w_is_mask {
|
||||
typedef wchar_t argument_type;
|
||||
typedef bool result_type;
|
||||
|
||||
ctype_base::mask M;
|
||||
const ctype_base::mask* table;
|
||||
|
||||
_Ctype_w_is_mask(ctype_base::mask m, const ctype_base::mask* t)
|
||||
: M(m), table(t) {}
|
||||
bool operator()(wchar_t c) const
|
||||
{ return c >= 0 && size_t(c) < ctype<char>::table_size && (table[c] & M); }
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ctype<wchar_t>
|
||||
|
||||
ctype<wchar_t>::~ctype() {}
|
||||
|
||||
|
||||
bool ctype<wchar_t>::do_is(ctype_base::mask m, wchar_t c) const
|
||||
{
|
||||
const ctype_base::mask * table = ctype<char>::classic_table();
|
||||
return c >= 0 && size_t(c) < ctype<char>::table_size && (m & table[c]);
|
||||
}
|
||||
|
||||
const wchar_t* ctype<wchar_t>::do_is(const wchar_t* low, const wchar_t* high,
|
||||
ctype_base::mask * vec) const
|
||||
{
|
||||
// boris : not clear if this is the right thing to do...
|
||||
const ctype_base::mask * table = ctype<char>::classic_table();
|
||||
for ( ; low < high; ++low, ++vec) {
|
||||
wchar_t c = *low;
|
||||
*vec = c >= 0 && size_t(c) < ctype<char>::table_size ? table[c] : ctype_base::mask (0);
|
||||
}
|
||||
return high;
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_scan_is(ctype_base::mask m,
|
||||
const wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
return find_if(low, high, _Ctype_w_is_mask(m, ctype<char>::classic_table()));
|
||||
}
|
||||
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_scan_not(ctype_base::mask m,
|
||||
const wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
return find_if(low, high, not1(_Ctype_w_is_mask(m, ctype<char>::classic_table())));
|
||||
}
|
||||
|
||||
wchar_t ctype<wchar_t>::do_toupper(wchar_t c) const
|
||||
{
|
||||
return c >= 0 && size_t(c) < ctype<char>::table_size
|
||||
? (wchar_t) ctype<char>::_S_upper[c]
|
||||
: c;
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
for ( ; low < high; ++low) {
|
||||
wchar_t c = *low;
|
||||
*low = c >= 0 && size_t(c) < ctype<char>::table_size
|
||||
? (wchar_t) ctype<char>::_S_upper[c]
|
||||
: c;
|
||||
}
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t ctype<wchar_t>::do_tolower(wchar_t c) const
|
||||
{
|
||||
return c >= 0 && size_t(c) < ctype<char>::table_size
|
||||
? (wchar_t) ctype<char>::_S_lower[c]
|
||||
: c;
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
for ( ; low < high; ++low) {
|
||||
wchar_t c = *low;
|
||||
*low = c >= 0 && size_t(c) < ctype<char>::table_size
|
||||
? (wchar_t) ctype<char>::_S_lower[c]
|
||||
: c;
|
||||
}
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t ctype<wchar_t>::do_widen(char c) const
|
||||
{
|
||||
return (wchar_t) c;
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype<wchar_t>::do_widen(const char* low, const char* high,
|
||||
wchar_t* dest) const
|
||||
{
|
||||
while (low != high)
|
||||
*dest++ = (wchar_t) *low++;
|
||||
return high;
|
||||
}
|
||||
|
||||
char ctype<wchar_t>::do_narrow(wchar_t c, char dfault) const
|
||||
{
|
||||
return (char) c == c ? c : dfault;
|
||||
}
|
||||
|
||||
const wchar_t* ctype<wchar_t>::do_narrow(const wchar_t* low,
|
||||
const wchar_t* high,
|
||||
char dfault, char* dest) const
|
||||
{
|
||||
while (low != high) {
|
||||
wchar_t c = *low++;
|
||||
*dest++ = (char) c == c ? c : dfault;
|
||||
}
|
||||
|
||||
return high;
|
||||
}
|
||||
|
||||
# endif
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
100
STLPORT/src/dec.mak
Normal file
100
STLPORT/src/dec.mak
Normal file
@@ -0,0 +1,100 @@
|
||||
#
|
||||
# Note : this requires GNU make
|
||||
#
|
||||
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_dec
|
||||
|
||||
CUR_DIR= $(PWD)/
|
||||
|
||||
# point this to proper location
|
||||
STL_INCL= -I. -I../stlport -I/usr/include
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
CC = cxx
|
||||
CXX = cxx
|
||||
|
||||
LINK=$(CXX) -o
|
||||
DYN_LINK=$(CXX) -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=DEC
|
||||
|
||||
# LINK_OUT=-xar -o
|
||||
# DYNLINK_OUT=-o
|
||||
|
||||
# all: all_dynamic all_static
|
||||
# Boris : do not see a reasonable way to link static library witout instantiating in .o
|
||||
# Anyone ?
|
||||
all: msg all_dynamic symbolic_links
|
||||
|
||||
msg:
|
||||
@echo "*** ATTENTION! ***"
|
||||
@echo "This makefile requires GNU make!"
|
||||
@echo "******************"
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
# Rules
|
||||
|
||||
MTFLAGS = -pthread
|
||||
|
||||
CXXFLAGS_COMMON = -std ansi -nousing_std -pt -rtti $(MTFLAGS) ${STL_INCL} -D_PTHREADS
|
||||
|
||||
SHCXXFLAGS = -shared
|
||||
RELEASE_FLAGS = -O
|
||||
|
||||
LIBS =
|
||||
|
||||
RELEASE_static_rep = -ptr ${RELEASE_OBJDIR_static}
|
||||
RELEASE_dynamic_rep = -ptr ${RELEASE_OBJDIR_dynamic}
|
||||
DEBUG_static_rep = -ptr ${DEBUG_OBJDIR_static}
|
||||
DEBUG_dynamic_rep = -ptr ${DEBUG_OBJDIR_dynamic}
|
||||
STLDEBUG_static_rep = -ptr ${STLDEBUG_OBJDIR_static}
|
||||
STLDEBUG_dynamic_rep = -ptr ${STLDEBUG_OBJDIR_dynamic}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) ${RELEASE_FLAGS} ${RELEASE_static_rep}
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) ${RELEASE_FLAGS} $(SHCXXFLAGS) ${RELEASE_dynamic_rep}
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g ${DEBUG_static_rep}
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g $(SHCXXFLAGS) ${DEBUG_dynamic_rep}
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_COMMON) -O -g ${STLDEBUG_static_rep} -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g $(SHCXXFLAGS) ${STLDEBUG_dynamic_rep} -D_STLP_DEBUG
|
||||
|
||||
LDFLAGS_RELEASE_static = ${CXXFLAGS_RELEASE_static}
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic}
|
||||
LDLIBS_RELEASE_dynamic = -lm
|
||||
LDLIBS_RELEASE_static = -lm
|
||||
|
||||
LDFLAGS_DEBUG_static = ${CXXFLAGS_DEBUG_static}
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic}
|
||||
LDLIBS_DEBUG_dynamic = -lm
|
||||
LDLIBS_DEBUG_static = -lm
|
||||
|
||||
LDFLAGS_STLDEBUG_static = ${CXXFLAGS_STLDEBUG_static}
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic}
|
||||
LDLIBS_STLDEBUG_dynamic = -lm
|
||||
LDLIBS_STLDEBUG_static = -lm
|
||||
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
%.i : %.cpp
|
||||
$(CXX) $(CXXFLAGS) $*.cpp -v -E > $@
|
||||
|
||||
%.s: %.cpp
|
||||
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
72
STLPORT/src/djgpp.mak
Normal file
72
STLPORT/src/djgpp.mak
Normal file
@@ -0,0 +1,72 @@
|
||||
|
||||
#
|
||||
# This is makefile for compiling with DJGPP.
|
||||
# Since DJGPP is used to create DOS protected mode, it has no
|
||||
# dynamic link library. Only static libraries are created.
|
||||
# With DJGPP, gcc is used to compile c++. It will know the
|
||||
# language being compiled automatically from file extension of
|
||||
# the source code being compiled.
|
||||
#
|
||||
# Tanes Sriviroolchai (tanes73@yahoo.com)
|
||||
# Jan 4, 2001
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = gcc
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_djgpp
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar crv
|
||||
|
||||
OBJEXT=o
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=DJGPP
|
||||
|
||||
STATIC_SUFFIX=_static
|
||||
|
||||
all: all_static
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
RESFILE=$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)stlport.o
|
||||
RESFILE_debug=$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o
|
||||
RESFILE_stldebug=$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o
|
||||
|
||||
WARNING_FLAGS= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS} -ftemplate-depth-32 -mbnu210
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
|
||||
LDFLAGS_RELEASE_static =
|
||||
|
||||
LDFLAGS_DEBUG_static =
|
||||
|
||||
LDFLAGS_STLDEBUG_static =
|
||||
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
257
STLPORT/src/dll_main.cpp
Normal file
257
STLPORT/src/dll_main.cpp
Normal file
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1997
|
||||
* Moscow Center for SPARC Technology
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# define __PUT_STATIC_DATA_MEMBERS_HERE
|
||||
# define _STLP_EXPOSE_GLOBALS_IMPLEMENTATION
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
# if !defined(_STLP_DEBUG) && ! defined (_STLP_ASSERTIONS)
|
||||
# define _STLP_ASSERTIONS 1
|
||||
# endif
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <stl/debug/_debug.h>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <list>
|
||||
#include <slist>
|
||||
#include <stl/_hashtable.h>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <bitset>
|
||||
|
||||
# if ( _STLP_STATIC_TEMPLATE_DATA < 1 )
|
||||
// for rope, locale static members
|
||||
# include <rope>
|
||||
# include <locale>
|
||||
# endif
|
||||
|
||||
# if defined (_STLP_UNIX)
|
||||
# define _STLP_HAS_PERTHREAD_ALLOCATOR
|
||||
# include <stl/_pthread_alloc.h>
|
||||
# endif
|
||||
|
||||
// boris : this piece of code duplicated from _range_errors.h
|
||||
#undef _STLP_THROW_MSG
|
||||
#if defined(_STLP_THROW_RANGE_ERRORS)
|
||||
# ifndef _STLP_STDEXCEPT
|
||||
# include <stdexcept>
|
||||
# endif
|
||||
# ifndef _STLP_STRING
|
||||
# include <string>
|
||||
# endif
|
||||
# define _STLP_THROW_MSG(ex,msg) throw ex(string(msg))
|
||||
#else
|
||||
# if defined (_STLP_WINCE)
|
||||
# define _STLP_THROW_MSG(ex,msg) TerminateProcess(GetCurrentProcess(), 0)
|
||||
# else
|
||||
# include <cstdlib>
|
||||
# include <cstdio>
|
||||
# define _STLP_THROW_MSG(ex,msg) puts(msg),_STLP_ABORT()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _STLP_MSVC
|
||||
#pragma optimize("g",off)
|
||||
#endif
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
void _STLP_DECLSPEC _STLP_CALL __stl_throw_range_error(const char* __msg) {
|
||||
_STLP_THROW_MSG(range_error, __msg);
|
||||
}
|
||||
|
||||
void _STLP_DECLSPEC _STLP_CALL __stl_throw_out_of_range(const char* __msg) {
|
||||
_STLP_THROW_MSG(out_of_range, __msg);
|
||||
}
|
||||
|
||||
void _STLP_DECLSPEC _STLP_CALL __stl_throw_length_error(const char* __msg) {
|
||||
_STLP_THROW_MSG(length_error, __msg);
|
||||
}
|
||||
|
||||
void _STLP_DECLSPEC _STLP_CALL __stl_throw_invalid_argument(const char* __msg) {
|
||||
_STLP_THROW_MSG(invalid_argument, __msg);
|
||||
}
|
||||
|
||||
void _STLP_DECLSPEC _STLP_CALL __stl_throw_overflow_error(const char* __msg) {
|
||||
_STLP_THROW_MSG(overflow_error, __msg);
|
||||
}
|
||||
|
||||
_STLP_DECLSPEC const char* _STLP_CALL
|
||||
__get_c_string(const string& __str) {
|
||||
return __str.c_str();
|
||||
}
|
||||
|
||||
|
||||
# if defined (_STLP_NO_EXCEPTION_HEADER) || defined(_STLP_BROKEN_EXCEPTION_CLASS)
|
||||
exception::exception() _STLP_NOTHROW {}
|
||||
exception::~exception() _STLP_NOTHROW {}
|
||||
bad_exception::bad_exception() _STLP_NOTHROW {}
|
||||
bad_exception::~bad_exception() _STLP_NOTHROW {}
|
||||
const char* exception::what() const _STLP_NOTHROW {return "class exception";}
|
||||
const char* bad_exception::what() const _STLP_NOTHROW {return "class bad_exception";}
|
||||
# endif
|
||||
|
||||
# ifdef _STLP_OWN_STDEXCEPT
|
||||
__Named_exception::__Named_exception(const string& __str) {
|
||||
strncpy(_M_name, __get_c_string(__str), _S_bufsize);
|
||||
_M_name[_S_bufsize - 1] = '\0';
|
||||
}
|
||||
|
||||
const char* __Named_exception::what() const _STLP_NOTHROW_INHERENTLY { return _M_name; }
|
||||
|
||||
// boris : those are needed to force typeinfo nodes to be created in here only
|
||||
__Named_exception::~__Named_exception() _STLP_NOTHROW_INHERENTLY {}
|
||||
|
||||
logic_error::~logic_error() _STLP_NOTHROW_INHERENTLY {}
|
||||
runtime_error::~runtime_error() _STLP_NOTHROW_INHERENTLY {}
|
||||
domain_error::~domain_error() _STLP_NOTHROW_INHERENTLY {}
|
||||
invalid_argument::~invalid_argument() _STLP_NOTHROW_INHERENTLY {}
|
||||
length_error::~length_error() _STLP_NOTHROW_INHERENTLY {}
|
||||
out_of_range::~out_of_range() _STLP_NOTHROW_INHERENTLY {}
|
||||
range_error::~range_error() _STLP_NOTHROW_INHERENTLY {}
|
||||
overflow_error::~overflow_error() _STLP_NOTHROW_INHERENTLY {}
|
||||
underflow_error::~underflow_error() _STLP_NOTHROW_INHERENTLY {}
|
||||
|
||||
# endif
|
||||
|
||||
# ifdef _STLP_NO_BAD_ALLOC
|
||||
const nothrow_t nothrow /* = {} */;
|
||||
# endif
|
||||
|
||||
# ifndef _STLP_NO_FORCE_INSTANTIATE
|
||||
|
||||
# if defined (_STLP_DEBUG) || defined (_STLP_ASSERTIONS)
|
||||
template struct _STLP_CLASS_DECLSPEC __stl_debug_engine<bool>;
|
||||
# endif
|
||||
|
||||
template class _STLP_CLASS_DECLSPEC __node_alloc<false,0>;
|
||||
template class _STLP_CLASS_DECLSPEC __node_alloc<true,0>;
|
||||
template class _STLP_CLASS_DECLSPEC __debug_alloc< __node_alloc<true,0> >;
|
||||
template class _STLP_CLASS_DECLSPEC __debug_alloc< __node_alloc<false,0> >;
|
||||
template class _STLP_CLASS_DECLSPEC __debug_alloc<__new_alloc>;
|
||||
template class _STLP_CLASS_DECLSPEC __malloc_alloc<0>;
|
||||
|
||||
# if defined (_STLP_THREADS) && ! defined ( _STLP_ATOMIC_EXCHANGE ) && (defined(_STLP_PTHREADS) || defined (_STLP_UITHREADS) || defined (_STLP_OS2THREADS))
|
||||
template class _STLP_CLASS_DECLSPEC _Swap_lock_struct<0>;
|
||||
# endif
|
||||
|
||||
template class allocator<void*>;
|
||||
template class _STLP_alloc_proxy<void**, void*, allocator<void*> >;
|
||||
template class _Vector_base<void*,allocator<void*> >;
|
||||
# if defined (_STLP_DEBUG) && ! defined (__SUNPRO_CC)
|
||||
template class __WORKAROUND_DBG_RENAME(vector) <void*,allocator<void*> >;
|
||||
# endif
|
||||
template class __vector__<void*,allocator<void*> >;
|
||||
|
||||
template class _Rb_global<bool>;
|
||||
template class _List_global<bool>;
|
||||
template class _Sl_global<bool>;
|
||||
template class _Stl_prime<bool>;
|
||||
template class _LimG<bool>;
|
||||
template class _Bs_G<bool>;
|
||||
|
||||
template class _STLP_CLASS_DECLSPEC allocator<char>;
|
||||
template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<char *,char, allocator<char> >;
|
||||
template class _STLP_CLASS_DECLSPEC _String_base<char, allocator<char> >;
|
||||
|
||||
# if defined (_STLP_DEBUG) && ! defined (__SUNPRO_CC)
|
||||
template class _STLP_CLASS_DECLSPEC _Nondebug_string<char, char_traits<char>, allocator<char> >;
|
||||
# endif
|
||||
|
||||
template class basic_string<char, char_traits<char>, allocator<char> >;
|
||||
# endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
#define FORCE_SYMBOL extern
|
||||
|
||||
# if defined (_WIN32) && defined (_STLP_USE_DECLSPEC) && ! defined (_STLP_USE_STATIC_LIB) && ! defined (_STLP_USE_STATICX_LIB)
|
||||
// stlportmt.cpp : Defines the entry point for the DLL application.
|
||||
//
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#undef FORCE_SYMBOL
|
||||
#define FORCE_SYMBOL APIENTRY
|
||||
|
||||
extern "C" {
|
||||
|
||||
BOOL APIENTRY DllMain( HANDLE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls((HINSTANCE)hModule);
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
void FORCE_SYMBOL
|
||||
force_link()
|
||||
{
|
||||
float f;
|
||||
f = numeric_limits<float>::infinity();
|
||||
f = numeric_limits<float>::quiet_NaN();
|
||||
f = numeric_limits<float>::signaling_NaN();
|
||||
double d;
|
||||
d = numeric_limits<double>::infinity();
|
||||
d = numeric_limits<double>::quiet_NaN();
|
||||
d = numeric_limits<double>::signaling_NaN();
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
long double ld;
|
||||
ld = numeric_limits<long double>::infinity();
|
||||
ld = numeric_limits<long double>::quiet_NaN();
|
||||
ld = numeric_limits<long double>::signaling_NaN();
|
||||
#endif
|
||||
|
||||
set<int>::iterator iter;
|
||||
// _M_increment; _M_decrement instantiation
|
||||
++iter;
|
||||
--iter;
|
||||
|
||||
// force bitset globals to be instantiated
|
||||
unsigned char uc = _Bs_G<bool>::_S_bit_count[0];
|
||||
uc += _Bs_G<bool>::_S_first_one[0];
|
||||
}
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
# endif
|
||||
1178
STLPORT/src/facets_byname.cpp
Normal file
1178
STLPORT/src/facets_byname.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1179
STLPORT/src/fstream.cpp
Normal file
1179
STLPORT/src/fstream.cpp
Normal file
File diff suppressed because it is too large
Load Diff
54
STLPORT/src/fstream_impl.h
Normal file
54
STLPORT/src/fstream_impl.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FSTREAM_IMPL_H
|
||||
# define FSTREAM_IMPL_H
|
||||
|
||||
#include <stl/_stdio_file.h>
|
||||
|
||||
# ifdef _STLP_HAS_NO_NAMESPACES
|
||||
# define __SGI_BEGIN_NAMESPACE
|
||||
# define __SGI_END_NAMESPACE
|
||||
# define _SgI
|
||||
# else
|
||||
# define __SGI_BEGIN_NAMESPACE namespace _SgI {
|
||||
# define __SGI_END_NAMESPACE }
|
||||
# endif
|
||||
|
||||
__SGI_BEGIN_NAMESPACE
|
||||
|
||||
# ifndef _STLP_HAS_NO_NAMESPACES
|
||||
using _STLP_STD::streamoff;
|
||||
using _STLP_STD::ios_base;
|
||||
using _STLP_STD::streamsize;
|
||||
using _STLP_STD::streamoff;
|
||||
using _STLP_STD::char_traits;
|
||||
# ifndef _STLP_USE_UNIX_IO
|
||||
using _STLP_VENDOR_CSTD::FILE;
|
||||
using _STLP_VENDOR_CSTD::ftell;
|
||||
# endif
|
||||
|
||||
using _STLP_STD::_FILE_fd;
|
||||
# endif
|
||||
|
||||
extern bool __is_regular_file(_STLP_fd fd);
|
||||
extern streamoff __file_size(_STLP_fd fd);
|
||||
|
||||
__SGI_END_NAMESPACE
|
||||
|
||||
#endif /* FSTREAM_IMPL_H */
|
||||
66
STLPORT/src/gcc-99r1-sun.mak
Normal file
66
STLPORT/src/gcc-99r1-sun.mak
Normal file
@@ -0,0 +1,66 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later !
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -pthreads
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc99r1
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
DYN_LINK=c++ -pthreads -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC-99r1
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
|
||||
|
||||
CXXFLAGS_COMMON = -nostdinc++ -fexceptions -ftemplate-depth-32 -D_STLP_HAS_NO_NAMESPACES -shared -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -gstabs
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -gstabs -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic}
|
||||
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic}
|
||||
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic}
|
||||
|
||||
LDLIBS_RELEASE_dynamic = -lposix4
|
||||
|
||||
LDLIBS_STLDEBUG_dynamic = -lposix4
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
46
STLPORT/src/gcc-amigaos-m68k.mak
Normal file
46
STLPORT/src/gcc-amigaos-m68k.mak
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95.3 and later !
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc -noixemul -m68020
|
||||
CXX = g++ -noixemul -m68020 -ftemplate-depth-32
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
OBJEXT=o
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC$(ARCH)
|
||||
|
||||
all: release_static
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -g
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) : $(OUTDIR) $(RELEASE_OBJDIR_static) $(DEF_FILE) $(RELEASE_OBJECTS_static)
|
||||
$(LINK) $(LINK_OUT)$(OUTDIR)$(PATH_SEP)$(RELEASE_LIB) $(LDFLAGS_RELEASE_static) $(RELEASE_OBJDIR_static)$(PATH_SEP)*.$(OBJEXT) $(LDLIBS_RELEASE_static)
|
||||
52
STLPORT/src/gcc-apple-macosx.mak
Normal file
52
STLPORT/src/gcc-apple-macosx.mak
Normal file
@@ -0,0 +1,52 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later !
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -fexceptions
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=libtool -static -o
|
||||
# 2.95 flag
|
||||
DYN_LINK=libtool -dynamic -framework System -lcc_dynamic -lstdc++ -install_name @executable_path/$(@F) -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=dylib
|
||||
STEXT=a
|
||||
RM=rm -Rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC$(ARCH)
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -ftemplate-depth-32
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fPIC
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
63
STLPORT/src/gcc-beos.mak
Normal file
63
STLPORT/src/gcc-beos.mak
Normal file
@@ -0,0 +1,63 @@
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar crv
|
||||
DYN_LINK=g++ -nostart -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC-BEOS
|
||||
|
||||
all: msg all_static
|
||||
|
||||
msg:
|
||||
mkdir -p ../stlport/beos
|
||||
./beos-setup -setup
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
|
||||
|
||||
# boris : real locale implementation does not really work
|
||||
# CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS} -D_STLP_REAL_LOCALE_IMPLEMENTED
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fPIC
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
install: all
|
||||
./beos-setup -install
|
||||
|
||||
uninstall:
|
||||
./beos-setup -uninstall
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
62
STLPORT/src/gcc-cygwin.mak
Normal file
62
STLPORT/src/gcc-cygwin.mak
Normal file
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++
|
||||
|
||||
COMP = cygwin
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_cygwin
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar crv
|
||||
DYN_LINK=c++ -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=dll
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=cygwin
|
||||
|
||||
# STATIC_SUFFIX=_static
|
||||
|
||||
all: all_static
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -D_STLP_USE_DYNAMIC_LIB
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -D_STLP_USE_DYNAMIC_LIB
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -D_STLP_USE_DYNAMIC_LIB
|
||||
|
||||
LDFLAGS_RELEASE_static =
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic} -Wl,-d
|
||||
|
||||
LDFLAGS_DEBUG_static =
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic} -Wl,--export-all-symbols -Wl,-d -Wl,--out-implib,${OUTDIR}/${DEBUG_NAME}.a
|
||||
|
||||
LDFLAGS_STLDEBUG_static =
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic} -Wl,--export-all-symbols -Wl,--out-implib,${OUTDIR}/${STLDEBUG_NAME}.a
|
||||
|
||||
include common_percent_rules.mak
|
||||
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
63
STLPORT/src/gcc-freebsd.mak
Normal file
63
STLPORT/src/gcc-freebsd.mak
Normal file
@@ -0,0 +1,63 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later !
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc -pthread
|
||||
CXX = c++ -pthread -fexceptions
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
DYN_LINK=c++ -pthread -fexceptions -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC-FREEBSD
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: gmake_message all_dynamic all_static symbolic_links
|
||||
|
||||
gmake_message:
|
||||
echo "Note : this makefile requires gmake on FreeBSD"
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -ftemplate-depth-32
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fPIC
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
60
STLPORT/src/gcc-glibc.mak
Normal file
60
STLPORT/src/gcc-glibc.mak
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar crv
|
||||
DYN_LINK=gcc -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC$(ARCH)
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: msg all_dynamic all_static symbolic_links
|
||||
|
||||
msg:
|
||||
@echo "*** ATTENTION! ***"
|
||||
@echo "This makefile tries to use system locale which might not work well with all glibc flavours."
|
||||
@echo "If build fails, please resort to gcc.mak which will build C-locale only version for STLport"
|
||||
@echo "******************"
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -D_STLP_USE_GLIBC
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS} -D_STLP_REAL_LOCALE_IMPLEMENTED
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fpic
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fpic
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fpic
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
69
STLPORT/src/gcc-hp.mak
Normal file
69
STLPORT/src/gcc-hp.mak
Normal file
@@ -0,0 +1,69 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later (HP-UX)!
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -pthreads
|
||||
|
||||
# -fkeep-inline-functions
|
||||
# -finline-functions
|
||||
# -fno-default-inline
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
# DYN_LINK=c++ -pthreads -fPIC -shared -o
|
||||
# DYN_LINK=c++ -pthreads -nostdinc++ -fexceptions -frtti -fPIC -O -fno-implement-inlines -Winline -Wextern-inline -shared -D_STLP_DEBUG -o
|
||||
# DYN_LINK=ld -shared -export-dynamic -Bdynamic -Bsymbolic -Ur -o
|
||||
DYN_LINK=ld -z -b -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=sl
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC-HP
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
|
||||
|
||||
# CXXFLAGS_COMMON = -ftemplate-depth-32 -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic} -Wl,+h${RELEASE_DYNLIB_SONAME}
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic} -Wl,+h${DEBUG_DYNLIB_SONAME}
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic} -Wl,+h${STLDEBUG_DYNLIB_SONAME}
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
75
STLPORT/src/gcc-hp11.mak
Normal file
75
STLPORT/src/gcc-hp11.mak
Normal file
@@ -0,0 +1,75 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later (HP-UX)!
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++
|
||||
|
||||
# -fkeep-inline-functions
|
||||
# -finline-functions
|
||||
# -fno-default-inline
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
# DYN_LINK=c++ -pthreads -fPIC -shared -o
|
||||
# DYN_LINK=c++ -pthreads -nostdinc++ -fexceptions -frtti -fPIC -O -fno-implement-inlines -Winline -Wextern-inline -shared -D_STLP_DEBUG -o
|
||||
# DYN_LINK=ld -shared -export-dynamic -Bdynamic -Bsymbolic -Ur -o
|
||||
# DYN_LINK=/usr/bin/ld -z -b -o
|
||||
|
||||
DYN_LINK= c++ -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=sl
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC-HP
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -D_REENTRANT -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__
|
||||
|
||||
# CXXFLAGS_COMMON = -ftemplate-depth-32 -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
# LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic} -Wl,+h${RELEASE_DYNLIB_SONAME}
|
||||
# LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic} -Wl,+h${DEBUG_DYNLIB_SONAME}
|
||||
# LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic} -Wl,+h${STLDEBUG_DYNLIB_SONAME}
|
||||
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic}
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic}
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic}
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
51
STLPORT/src/gcc-irix.mak
Normal file
51
STLPORT/src/gcc-irix.mak
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later !
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -fexceptions
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
DYN_LINK=c++ -lpthread -fexceptions -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC$(ARCH)
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -ftemplate-depth-32
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
62
STLPORT/src/gcc-linux.mak
Normal file
62
STLPORT/src/gcc-linux.mak
Normal file
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -pthread -fexceptions
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar crv
|
||||
DYN_LINK=gcc -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC-LINUX
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: msg all_dynamic all_static symbolic_links
|
||||
|
||||
msg:
|
||||
@echo "*** ATTENTION! ***"
|
||||
@echo "This makefile tries to use system locale which might not work well with all glibc flavours."
|
||||
@echo "If build fails, please resort to gcc.mak which will build C-locale only version for STLport"
|
||||
@echo "******************"
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -D_STLP_USE_GLIBC
|
||||
|
||||
# boris : real locale implementation may not really work
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS} -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE
|
||||
# CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fPIC
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
78
STLPORT/src/gcc-mingw32.mak
Normal file
78
STLPORT/src/gcc-mingw32.mak
Normal file
@@ -0,0 +1,78 @@
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_mingw32
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar crv
|
||||
DYN_LINK=c++ -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=dll
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=MINGW32
|
||||
|
||||
STATIC_SUFFIX=_static
|
||||
|
||||
all: all_dynamic all_static
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
RESFILE=$(RELEASE_OBJDIR_dynamic)$(PATH_SEP)stlport.o
|
||||
RESFILE_debug=$(DEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o
|
||||
RESFILE_stldebug=$(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o
|
||||
|
||||
WARNING_FLAGS= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
# CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -shared -D_STLP_USE_DYNAMIC_LIB
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -D_STLP_USE_DYNAMIC_LIB
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -shared -D_STLP_USE_DYNAMIC_LIB
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -shared -D_STLP_USE_DYNAMIC_LIB
|
||||
|
||||
LDFLAGS_RELEASE_static =
|
||||
# LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic} -Wl,--no-undefined, -Wl,--export-all-symbols -Wl,-d -Wl,--out-implib,${OUTDIR}/${RELEASE_NAME}.a
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic} -Wl,--export-all-symbols -Wl,-d -Wl,--out-implib,${OUTDIR}/${RELEASE_NAME}.a
|
||||
|
||||
LDFLAGS_DEBUG_static =
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic} -Wl,--export-all-symbols -Wl,-d -Wl,--out-implib,${OUTDIR}/${DEBUG_NAME}.a
|
||||
|
||||
LDFLAGS_STLDEBUG_static =
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic} -Wl,--export-all-symbols -Wl,--out-implib,${OUTDIR}/${STLDEBUG_NAME}.a
|
||||
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
${RESFILE}: stlport.rc
|
||||
windres -O coff --define COMP=${COMP} --define BUILD= -o $(RELEASE_OBJDIR_dynamic)$(PATH_SEP)stlport.o stlport.rc
|
||||
|
||||
${RESFILE_debug}: stlport.rc
|
||||
windres -O coff --define COMP=${COMP} --define BUILD=_DEBUG -o $(DEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o stlport.rc
|
||||
|
||||
${RESFILE_stldebug}: stlport.rc
|
||||
windres -O coff --define COMP=${COMP} --define BUILD=_STLDEBUG -o $(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o stlport.rc
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
60
STLPORT/src/gcc-ncr.mak
Normal file
60
STLPORT/src/gcc-ncr.mak
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later !
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -fexceptions
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
DYN_LINK=c++ -pthreads -fexceptions -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC-NCR
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -ftemplate-depth-32
|
||||
|
||||
CXXFLAGS_COMMON = -D__NCR_SVR -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
60
STLPORT/src/gcc-netbsd.mak
Normal file
60
STLPORT/src/gcc-netbsd.mak
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later !
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -fexceptions
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar crv
|
||||
# 2.95 flag
|
||||
DYN_LINK=c++ -lpthread -fexceptions -shared -fPIC -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC-NETBSD
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -ftemplate-depth-32
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fPIC
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
71
STLPORT/src/gcc-sun.mak
Normal file
71
STLPORT/src/gcc-sun.mak
Normal file
@@ -0,0 +1,71 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later !
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -pthreads
|
||||
|
||||
CUR_DIR= ${PWD}/
|
||||
|
||||
STLPORT_DIR=${PWD}/../stlport
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
DYN_LINK=c++ -pthreads -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC-SUN
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
|
||||
|
||||
CXXFLAGS_COMMON = -fexceptions -ftemplate-depth-32 -shared -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -gstabs
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -gstabs -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
# LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic} -Wl,-soname,${RELEASE_DYNLIB_SONAME}
|
||||
# LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic} -Wl,-soname,${DEBUG_DYNLIB_SONAME}
|
||||
# LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic} -Wl,-soname,${STLDEBUG_DYNLIB_SONAME}
|
||||
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic}
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic}
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic}
|
||||
|
||||
# LDLIBS_RELEASE_dynamic = -lposix4
|
||||
# LDLIBS_STLDEBUG_dynamic = -lposix4
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
60
STLPORT/src/gcc.mak
Normal file
60
STLPORT/src/gcc.mak
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Note : this makefile is for gcc-2.95 and later !
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -pthread -fexceptions
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
DYN_LINK=c++ -pthread -fexceptions -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC$(ARCH)
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -ftemplate-depth-32
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
55
STLPORT/src/gcc7.mak
Normal file
55
STLPORT/src/gcc7.mak
Normal file
@@ -0,0 +1,55 @@
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = c++
|
||||
CXX = $(CC)
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar crv
|
||||
DYN_LINK=ar crv
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC7${ARCH}
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -D_STLP_NO_TYPEINFO -D_STLP_NO_EXCEPTIONS -frtti
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fpic
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fpic
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fpic
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
56
STLPORT/src/gcc8.mak
Normal file
56
STLPORT/src/gcc8.mak
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = gcc
|
||||
CXX = c++ -fexceptions -D__EXCEPTIONS -ftemplate-depth-20
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_gcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar crv
|
||||
DYN_LINK=ar crv
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=GCC8${ARCH}
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_static
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
# -O does not always work for gcc-2.8
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON)
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -fpic
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fpic
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fpic
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
58
STLPORT/src/hpacc.mak
Normal file
58
STLPORT/src/hpacc.mak
Normal file
@@ -0,0 +1,58 @@
|
||||
#
|
||||
# Makefile for HP aCC 1.23 compiler or later
|
||||
#
|
||||
CC = aCC
|
||||
CXX = aCC
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_aCC
|
||||
|
||||
OPTIM=+O2 +Onolimit
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
# 2.95 flag
|
||||
DYN_LINK=aCC -b ${OPTIM} +nostl -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=sl
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=ACC$(ARCH)
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS=
|
||||
|
||||
# CXXFLAGS_COMMON = +ESlit -Aa -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
# CXXFLAGS_COMMON = -Aa -I${STLPORT_DIR} -D_REENTRANT +inst_close ${WARNING_FLAGS}
|
||||
CXXFLAGS_COMMON = -AA -I${STLPORT_DIR} +inst_close ${WARNING_FLAGS} ${CXX_EXTRA_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) ${OPTIM} -z
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) ${OPTIM} -z +Z
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -g ${OPTIM} -z
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -g ${OPTIM} -z +Z
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
60
STLPORT/src/icc.mak
Normal file
60
STLPORT/src/icc.mak
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Note: This makefile is for the Linux Intel C++ compiler 'icc'
|
||||
#
|
||||
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = icc
|
||||
CXX = icpc -pthread
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_icc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=ar cr
|
||||
DYN_LINK=icc -pthread -shared -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=ICC
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_dynamic all_static symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
WARNING_FLAGS= -w1
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O3 -ipo -ipo_obj
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O3 -fPIC -ipo -ipo_obj
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O0 -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O0 -g -fPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
#install: all
|
||||
# cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
|
||||
|
||||
#%.s: %.cpp
|
||||
# $(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
|
||||
|
||||
|
||||
|
||||
238
STLPORT/src/install.sh
Normal file
238
STLPORT/src/install.sh
Normal file
@@ -0,0 +1,238 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
#
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
tranformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
22
STLPORT/src/intel.mak
Normal file
22
STLPORT/src/intel.mak
Normal file
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# Tools
|
||||
#
|
||||
|
||||
CXX=icl.exe
|
||||
CC=icl.exe
|
||||
RC=rc
|
||||
|
||||
LIB_BASENAME=stlport_icl
|
||||
|
||||
EXTRA_COMMON_FLAGS=/D "_MBCS"
|
||||
COMP=ICL
|
||||
|
||||
all: all_static
|
||||
|
||||
!INCLUDE vc_common.mak
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
||||
26
STLPORT/src/intel40.mak
Normal file
26
STLPORT/src/intel40.mak
Normal file
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# Tools
|
||||
#
|
||||
|
||||
CXX=icl.exe
|
||||
CC=icl.exe
|
||||
RC=rc
|
||||
|
||||
LIB_BASENAME=stlport_icl
|
||||
|
||||
# EXTRA_COMMON_FLAGS=/D "_MBCS"
|
||||
EXTRA_COMMON_FLAGS= -D_MBCS
|
||||
EXTRA_DEBUG_FLAGS=
|
||||
EXTRA_NDEBUG_FLAGS= -Qipo -Qsox-
|
||||
|
||||
COMP=ICL
|
||||
|
||||
all: all_static
|
||||
|
||||
!INCLUDE vc_common.mak
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
||||
30
STLPORT/src/intel45.mak
Normal file
30
STLPORT/src/intel45.mak
Normal file
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# Makefile for Intel C++ compiler v.4.5
|
||||
|
||||
#
|
||||
# Tools
|
||||
#
|
||||
CXX=icl.exe
|
||||
CC=icl.exe
|
||||
# Intel frontend tools
|
||||
# LINK=xilib.exe
|
||||
|
||||
DYN_LINK=xilink.exe
|
||||
|
||||
|
||||
LIB_BASENAME=stlport_icl
|
||||
COMP=ICL
|
||||
|
||||
EXTRA_COMMON_FLAGS= -D_MBCS -Qwd186
|
||||
EXTRA_DEBUG_FLAGS=
|
||||
EXTRA_NDEBUG_FLAGS= -Qsox-
|
||||
|
||||
all: platform all_dynamic all_static
|
||||
|
||||
!INCLUDE vc_common.mak
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
||||
33
STLPORT/src/intel50.mak
Normal file
33
STLPORT/src/intel50.mak
Normal file
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# Makefile for Intel C++ compiler v.5.0
|
||||
|
||||
#
|
||||
# Tools
|
||||
#
|
||||
|
||||
CXX=icl.exe
|
||||
CC=icl.exe
|
||||
RC=rc
|
||||
|
||||
# Intel frontend tools
|
||||
# LINK=xilib.exe
|
||||
|
||||
DYN_LINK=xilink.exe
|
||||
|
||||
|
||||
LIB_BASENAME=stlport_icl
|
||||
COMP=ICL
|
||||
|
||||
EXTRA_COMMON_FLAGS= -D_MBCS -Qwd186,985
|
||||
EXTRA_DEBUG_FLAGS=
|
||||
EXTRA_NDEBUG_FLAGS= -Qsox-
|
||||
|
||||
all: platform all_static all_dynamic
|
||||
|
||||
!INCLUDE vc_common.mak
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
||||
313
STLPORT/src/ios.cpp
Normal file
313
STLPORT/src/ios.cpp
Normal file
@@ -0,0 +1,313 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
# include <algorithm>
|
||||
# include <stl/_ios.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
char* _STLP_CALL
|
||||
__write_integer(char* buf, ios_base::fmtflags flags, long x);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ios_base members
|
||||
|
||||
// class ios_base::failure, a subclass of exception. It's used solely
|
||||
// for reporting errors.
|
||||
|
||||
ios_base::failure::failure(const string& s)
|
||||
: __Named_exception(s)
|
||||
{}
|
||||
|
||||
ios_base::failure::~failure() _STLP_NOTHROW_INHERENTLY {}
|
||||
|
||||
#if !defined (_STLP_STATIC_CONST_INIT_BUG)
|
||||
|
||||
// Definitions of ios_base's formatting flags.
|
||||
const ios_base::fmtflags ios_base::left;
|
||||
const ios_base::fmtflags ios_base::right;
|
||||
const ios_base::fmtflags ios_base::internal;
|
||||
const ios_base::fmtflags ios_base::dec;
|
||||
const ios_base::fmtflags ios_base::hex;
|
||||
const ios_base::fmtflags ios_base::oct;
|
||||
const ios_base::fmtflags ios_base::fixed;
|
||||
const ios_base::fmtflags ios_base::scientific;
|
||||
const ios_base::fmtflags ios_base::boolalpha;
|
||||
const ios_base::fmtflags ios_base::showbase;
|
||||
const ios_base::fmtflags ios_base::showpoint;
|
||||
const ios_base::fmtflags ios_base::showpos;
|
||||
const ios_base::fmtflags ios_base::skipws;
|
||||
const ios_base::fmtflags ios_base::unitbuf;
|
||||
const ios_base::fmtflags ios_base::uppercase;
|
||||
const ios_base::fmtflags ios_base::adjustfield;
|
||||
const ios_base::fmtflags ios_base::basefield;
|
||||
const ios_base::fmtflags ios_base::floatfield;
|
||||
|
||||
// Definitions of ios_base's state flags.
|
||||
const ios_base::iostate ios_base::goodbit;
|
||||
const ios_base::iostate ios_base::badbit;
|
||||
const ios_base::iostate ios_base::eofbit;
|
||||
const ios_base::iostate ios_base::failbit;
|
||||
|
||||
// Definitions of ios_base's openmode flags.
|
||||
const ios_base::openmode ios_base::app;
|
||||
const ios_base::openmode ios_base::ate;
|
||||
const ios_base::openmode ios_base::binary;
|
||||
const ios_base::openmode ios_base::in;
|
||||
const ios_base::openmode ios_base::out;
|
||||
const ios_base::openmode ios_base::trunc;
|
||||
|
||||
// Definitions of ios_base's seekdir flags.
|
||||
const ios_base::seekdir ios_base::beg;
|
||||
const ios_base::seekdir ios_base::cur;
|
||||
const ios_base::seekdir ios_base::end;
|
||||
|
||||
# endif /* _STLP_STATIC_CONST_INIT_BUG */
|
||||
|
||||
// Internal functions used for managing exponentially-growing arrays of
|
||||
// POD types.
|
||||
|
||||
// array is a pointer to N elements of type PODType. Expands the array,
|
||||
// if necessary, so that array[index] is meaningful. All new elements are
|
||||
// initialized to zero. Returns a pointer to the new array, and the new
|
||||
// size.
|
||||
template <class PODType>
|
||||
pair<PODType*, size_t>
|
||||
_Stl_expand_array(PODType* array, size_t N, int index)
|
||||
{
|
||||
if ((int)N < index + 1) {
|
||||
size_t new_N = (max)(2 * N, size_t(index + 1));
|
||||
PODType* new_array
|
||||
= __STATIC_CAST(PODType*,realloc(array, new_N * sizeof(PODType)));
|
||||
if (new_array) {
|
||||
fill(new_array + N, new_array + new_N, PODType());
|
||||
return pair<PODType*, size_t>(new_array, new_N);
|
||||
}
|
||||
else
|
||||
return pair<PODType*, size_t>(__STATIC_CAST(PODType*,0), 0);
|
||||
}
|
||||
else
|
||||
return pair<PODType*, size_t>(array, N);
|
||||
}
|
||||
|
||||
// array is a pointer to N elements of type PODType. Allocate a new
|
||||
// array of N elements, copying the values from the old array to the new.
|
||||
// Return a pointer to the new array. It is assumed that array is non-null
|
||||
// and N is nonzero.
|
||||
template <class PODType>
|
||||
PODType* _Stl_copy_array(const PODType* array, size_t N) {
|
||||
PODType* result = __STATIC_CAST(PODType*,malloc(N * sizeof(PODType)));
|
||||
if (result)
|
||||
copy(array, array + N, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
locale ios_base::imbue(const locale& loc) {
|
||||
locale previous = _M_locale;
|
||||
_M_locale = loc;
|
||||
_M_invoke_callbacks(imbue_event);
|
||||
return previous;
|
||||
}
|
||||
|
||||
int ios_base::_S_index = 0;
|
||||
|
||||
int _STLP_CALL ios_base::xalloc()
|
||||
{
|
||||
static _STLP_STATIC_MUTEX L _STLP_MUTEX_INITIALIZER;
|
||||
_STLP_auto_lock sentry(L);
|
||||
return _S_index++;
|
||||
}
|
||||
|
||||
long& ios_base::iword(int index) {
|
||||
static long dummy = 0;
|
||||
|
||||
pair<long*, size_t> tmp = _Stl_expand_array(_M_iwords, _M_num_iwords, index);
|
||||
if (tmp.first) { // The allocation, if any, succeeded.
|
||||
_M_iwords = tmp.first;
|
||||
_M_num_iwords = tmp.second;
|
||||
return _M_iwords[index];
|
||||
}
|
||||
else {
|
||||
_M_setstate_nothrow(badbit);
|
||||
_M_check_exception_mask();
|
||||
return dummy;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void*& ios_base::pword(int index) {
|
||||
static void* dummy = 0;
|
||||
|
||||
pair<void**, size_t> tmp = _Stl_expand_array(_M_pwords, _M_num_pwords, index);
|
||||
if (tmp.first) { // The allocation, if any, succeeded.
|
||||
_M_pwords = tmp.first;
|
||||
_M_num_pwords = tmp.second;
|
||||
return _M_pwords[index];
|
||||
}
|
||||
else {
|
||||
_M_setstate_nothrow(badbit);
|
||||
_M_check_exception_mask();
|
||||
return dummy;
|
||||
}
|
||||
}
|
||||
|
||||
void ios_base::register_callback(event_callback __fn, int index) {
|
||||
pair<pair<event_callback, int>*, size_t> tmp
|
||||
= _Stl_expand_array(_M_callbacks, _M_num_callbacks, (int)_M_callback_index /* fbp: index ??? */ );
|
||||
if (tmp.first) {
|
||||
_M_callbacks = tmp.first;
|
||||
_M_num_callbacks = tmp.second;
|
||||
_M_callbacks[_M_callback_index++] = make_pair(__fn, index);
|
||||
}
|
||||
else {
|
||||
_M_setstate_nothrow(badbit);
|
||||
_M_check_exception_mask();
|
||||
}
|
||||
}
|
||||
|
||||
// Invokes all currently registered callbacks for a particular event.
|
||||
// Behaves correctly even if one of the callbacks adds a new callback.
|
||||
void ios_base::_M_invoke_callbacks(event E) {
|
||||
for (size_t i = _M_callback_index; i > 0; --i) {
|
||||
event_callback f = _M_callbacks[i-1].first;
|
||||
int n = _M_callbacks[i-1].second;
|
||||
f(E, *this, n);
|
||||
}
|
||||
}
|
||||
|
||||
// This function is called if the state, rdstate(), has a bit set
|
||||
// that is also set in the exception mask exceptions().
|
||||
void ios_base::_M_throw_failure() {
|
||||
const char* arg ;
|
||||
# if 0
|
||||
char buffer[256];
|
||||
char* ptr;
|
||||
strcpy(buffer, "ios failure: rdstate = 0x");
|
||||
ptr = __write_integer(buffer+strlen(buffer), ios_base::hex, __STATIC_CAST(unsigned long,_M_iostate));
|
||||
strcpy(ptr, " mask = 0x");
|
||||
ptr = __write_integer(buffer+strlen(buffer), ios_base::hex, __STATIC_CAST(unsigned long,_M_exception_mask));
|
||||
*ptr = 0;
|
||||
arg = buffer;
|
||||
# else
|
||||
arg = "ios failure";
|
||||
# endif
|
||||
|
||||
# ifndef _STLP_USE_EXCEPTIONS
|
||||
fputs(arg, stderr);
|
||||
# else
|
||||
throw failure(arg);
|
||||
# endif
|
||||
}
|
||||
|
||||
// Copy x's state to *this. This member function is used in the
|
||||
// implementation of basic_ios::copyfmt. Does not copy _M_exception_mask
|
||||
// or _M_iostate.
|
||||
void ios_base::_M_copy_state(const ios_base& x) {
|
||||
_M_fmtflags = x._M_fmtflags; // Copy the flags, except for _M_iostate
|
||||
_M_openmode = x._M_openmode; // and _M_exception_mask.
|
||||
_M_seekdir = x._M_seekdir;
|
||||
_M_precision = x._M_precision;
|
||||
_M_width = x._M_width;
|
||||
|
||||
if (_M_locale != x._M_locale) {
|
||||
_M_locale = x._M_locale;
|
||||
_M_cached_ctype = x._M_cached_ctype;
|
||||
_M_cached_numpunct = x._M_cached_numpunct;
|
||||
}
|
||||
|
||||
if (x._M_callbacks) {
|
||||
pair<event_callback, int>* tmp = _Stl_copy_array(x._M_callbacks, x._M_callback_index);
|
||||
if (tmp) {
|
||||
free(_M_callbacks);
|
||||
_M_callbacks = tmp;
|
||||
_M_num_callbacks = _M_callback_index = x._M_callback_index;
|
||||
}
|
||||
else {
|
||||
_M_setstate_nothrow(badbit);
|
||||
_M_check_exception_mask();
|
||||
}
|
||||
}
|
||||
|
||||
if (x._M_iwords) {
|
||||
long* tmp = _Stl_copy_array(x._M_iwords, x._M_num_iwords);
|
||||
if (tmp) {
|
||||
free(_M_iwords);
|
||||
_M_iwords = tmp;
|
||||
_M_num_iwords = x._M_num_iwords;
|
||||
}
|
||||
else {
|
||||
_M_setstate_nothrow(badbit);
|
||||
_M_check_exception_mask();
|
||||
}
|
||||
}
|
||||
|
||||
if (x._M_pwords) {
|
||||
void** tmp = _Stl_copy_array(x._M_pwords, x._M_num_pwords);
|
||||
if (tmp) {
|
||||
free(_M_pwords);
|
||||
_M_pwords = tmp;
|
||||
_M_num_pwords = x._M_num_pwords;
|
||||
}
|
||||
else {
|
||||
_M_setstate_nothrow(badbit);
|
||||
_M_check_exception_mask();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ios's (protected) default constructor. The standard says that all
|
||||
// fields have indeterminate values; we initialize them to zero for
|
||||
// simplicity. The only thing that really matters is that the arrays
|
||||
// are all initially null pointers, and the array element counts are all
|
||||
// initially zero.
|
||||
ios_base::ios_base()
|
||||
: _M_fmtflags(0), _M_iostate(0), _M_openmode(0), _M_seekdir(0),
|
||||
_M_exception_mask(0),
|
||||
_M_precision(0), _M_width(0),
|
||||
_M_locale(),
|
||||
_M_callbacks(0), _M_num_callbacks(0), _M_callback_index(0),
|
||||
_M_iwords(0), _M_num_iwords(0),
|
||||
_M_pwords(0),
|
||||
_M_num_pwords(0) , _M_cached_ctype(0), _M_cached_numpunct(0)
|
||||
{ }
|
||||
|
||||
// ios's destructor.
|
||||
ios_base::~ios_base() {
|
||||
_M_invoke_callbacks(erase_event);
|
||||
free(_M_callbacks);
|
||||
free(_M_iwords);
|
||||
free(_M_pwords);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Force instantiation of basic_ios
|
||||
// For DLL exports, they are already instantiated.
|
||||
# if !defined(_STLP_NO_FORCE_INSTANTIATE)
|
||||
template class _STLP_CLASS_DECLSPEC basic_ios<char, char_traits<char> >;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
template class _STLP_CLASS_DECLSPEC basic_ios<wchar_t, char_traits<wchar_t> >;
|
||||
# endif /* _STLP_NO_WCHAR_T */
|
||||
# endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
396
STLPORT/src/iostream.cpp
Normal file
396
STLPORT/src/iostream.cpp
Normal file
@@ -0,0 +1,396 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
#include <istream>
|
||||
// #include <stl/_istream.h>
|
||||
|
||||
#include <stl/_fstream.h>
|
||||
#include <stdio_streambuf>
|
||||
#include "aligned_buffer.h"
|
||||
|
||||
// boris : note this is repeated in <iostream>
|
||||
#ifndef _STLP_USE_NAMESPACES
|
||||
// in case of SGI iostreams, we have to rename our streams not to clash with those
|
||||
// provided in native lib
|
||||
# define cin _STLP_cin
|
||||
# define cout _STLP_cout
|
||||
# define cerr _STLP_cerr
|
||||
# define clog _STLP_clog
|
||||
#endif
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
#if defined (__BORLANDC__) && ! defined (_STLP_USE_GLIBC)
|
||||
using _STLP_VENDOR_CSTD::_streams;
|
||||
#endif
|
||||
|
||||
// This file handles iostream initialization. It is inherently
|
||||
// nonportable, since the C++ language definition provides no mechanism
|
||||
// for controlling order of initialization of nonlocal objects.
|
||||
// Initialization has three parts, which must be performed in the following
|
||||
// order:
|
||||
// (1) Initialize the locale system
|
||||
// (2) Call the constructors for the eight global stream objects.
|
||||
// (3) Create streambufs for the global stream objects, and initialize
|
||||
// the stream objects by calling the init() member function.
|
||||
|
||||
|
||||
#if defined (_STLP_MSVC) || defined(__MWERKS__) || defined (__ICL) || defined (__ISCPP__)
|
||||
|
||||
// Definitions of the eight global I/O objects that are declared in
|
||||
// <iostream>. For VC++ we use the init_seg pragma to put the global I/O
|
||||
// objects into an intitialization segement that will not
|
||||
// be executed. We then explicitly invoke the constructors
|
||||
// with placement new in ios_base::_S_initialize()
|
||||
|
||||
#if defined(__MWERKS__)
|
||||
# pragma suppress_init_code on
|
||||
#else
|
||||
# pragma init_seg("STLPORT_NO_INIT")
|
||||
#endif
|
||||
|
||||
_STLP_DECLSPEC istream cin(0);
|
||||
_STLP_DECLSPEC ostream cout(0);
|
||||
_STLP_DECLSPEC ostream cerr(0);
|
||||
_STLP_DECLSPEC ostream clog(0);
|
||||
|
||||
_STLP_DECLSPEC wistream wcin(0);
|
||||
_STLP_DECLSPEC wostream wcout(0);
|
||||
_STLP_DECLSPEC wostream wcerr(0);
|
||||
_STLP_DECLSPEC wostream wclog(0);
|
||||
|
||||
#if defined(__MWERKS__)
|
||||
# pragma suppress_init_code off
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||
// Definitions of the eight global I/O objects that are declared in
|
||||
// <iostream>. Disgusting hack: we deliberately define them with the
|
||||
// wrong types so that the constructors don't get run automatically.
|
||||
// We need special tricks to make sure that these objects are struct-
|
||||
// aligned rather than byte-aligned.
|
||||
|
||||
// This is not portable. Declaring a variable with different types in
|
||||
// two translations units is "undefined", according to the C++ standard.
|
||||
// Most compilers, however, silently accept this instead of diagnosing
|
||||
// it as an error.
|
||||
|
||||
#ifndef __DMC__
|
||||
_STLP_DECLSPEC _Stl_aligned_buffer<istream> cin;
|
||||
_STLP_DECLSPEC _Stl_aligned_buffer<ostream> cout;
|
||||
_STLP_DECLSPEC _Stl_aligned_buffer<ostream> cerr;
|
||||
_STLP_DECLSPEC _Stl_aligned_buffer<ostream> clog;
|
||||
#else
|
||||
_Stl_aligned_buffer<istream> cin;
|
||||
_Stl_aligned_buffer<ostream> cout;
|
||||
_Stl_aligned_buffer<ostream> cerr;
|
||||
_Stl_aligned_buffer<ostream> clog;
|
||||
|
||||
#pragma alias("?cin@std@@3V?$basic_istream@std@DV?$char_traits@std@D@1@@1@A", "?cin@std@@3T?$_Stl_aligned_buffer@std@V?$basic_istream@std@DV?$char_traits@std@D@1@@1@@1@A")
|
||||
#pragma alias("?cout@std@@3V?$basic_ostream@std@DV?$char_traits@std@D@1@@1@A", "?cout@std@@3T?$_Stl_aligned_buffer@std@V?$basic_ostream@std@DV?$char_traits@std@D@1@@1@@1@A")
|
||||
#pragma alias("?cerr@std@@3V?$basic_ostream@std@DV?$char_traits@std@D@1@@1@A", "?cerr@std@@3T?$_Stl_aligned_buffer@std@V?$basic_ostream@std@DV?$char_traits@std@D@1@@1@@1@A")
|
||||
#pragma alias("?clog@std@@3V?$basic_ostream@std@DV?$char_traits@std@D@1@@1@A", "?clog@std@@3T?$_Stl_aligned_buffer@std@V?$basic_ostream@std@DV?$char_traits@std@D@1@@1@@1@A")
|
||||
#endif
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
#ifndef __DMC__
|
||||
_STLP_DECLSPEC _Stl_aligned_buffer<wistream> wcin;
|
||||
_STLP_DECLSPEC _Stl_aligned_buffer<wostream> wcout;
|
||||
_STLP_DECLSPEC _Stl_aligned_buffer<wostream> wcerr;
|
||||
_STLP_DECLSPEC _Stl_aligned_buffer<wostream> wclog;
|
||||
#else
|
||||
_Stl_aligned_buffer<wistream> wcin;
|
||||
_Stl_aligned_buffer<wostream> wcout;
|
||||
_Stl_aligned_buffer<wostream> wcerr;
|
||||
_Stl_aligned_buffer<wostream> wclog;
|
||||
|
||||
#pragma alias("?wcin@std@@3V?$basic_istream@std@_YV?$char_traits@std@_Y@1@@1@A", "?wcin@std@@3T?$_Stl_aligned_buffer@std@V?$basic_istream@std@_YV?$char_traits@std@_Y@1@@1@@1@A")
|
||||
#pragma alias("?wcout@std@@3V?$basic_ostream@std@_YV?$char_traits@std@_Y@1@@1@A", "?wcout@std@@3T?$_Stl_aligned_buffer@std@V?$basic_ostream@std@_YV?$char_traits@std@_Y@1@@1@@1@A")
|
||||
#pragma alias("?wcerr@std@@3V?$basic_ostream@std@_YV?$char_traits@std@_Y@1@@1@A", "?wcerr@std@@3T?$_Stl_aligned_buffer@std@V?$basic_ostream@std@_YV?$char_traits@std@_Y@1@@1@@1@A")
|
||||
#pragma alias("?wclog@std@@3V?$basic_ostream@std@_YV?$char_traits@std@_Y@1@@1@A", "?wclog@std@@3T?$_Stl_aligned_buffer@std@V?$basic_ostream@std@_YV?$char_traits@std@_Y@1@@1@@1@A")
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* STL_MSVC || __MWERKS__ */
|
||||
|
||||
// Member functions from class ios_base and ios_base::Init
|
||||
|
||||
long ios_base::Init::_S_count = 0;
|
||||
// by default, those are synced
|
||||
bool ios_base::_S_was_synced = true;
|
||||
|
||||
ios_base::Init::Init() {
|
||||
if (_S_count == 0)
|
||||
ios_base::_S_initialize();
|
||||
}
|
||||
|
||||
ios_base::Init::~Init() {
|
||||
if (_S_count > 0)
|
||||
ios_base::_S_uninitialize();
|
||||
}
|
||||
|
||||
|
||||
filebuf*
|
||||
_Stl_create_filebuf(FILE* f, ios_base::openmode mode )
|
||||
{
|
||||
basic_filebuf<char, char_traits<char> >* result;
|
||||
|
||||
result = new basic_filebuf<char, char_traits<char> >();
|
||||
|
||||
_STLP_TRY {
|
||||
result->_M_open(_FILE_fd(f), mode);
|
||||
}
|
||||
_STLP_CATCH_ALL {}
|
||||
|
||||
if (!result->is_open()) {
|
||||
delete result;
|
||||
result = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
wfilebuf*
|
||||
_Stl_create_wfilebuf(FILE* f, ios_base::openmode mode )
|
||||
{
|
||||
basic_filebuf<wchar_t, char_traits<wchar_t> >* result;
|
||||
|
||||
result = new basic_filebuf<wchar_t, char_traits<wchar_t> >();
|
||||
|
||||
_STLP_TRY {
|
||||
result->_M_open(_FILE_fd(f), mode);
|
||||
}
|
||||
_STLP_CATCH_ALL {}
|
||||
|
||||
if (!result->is_open()) {
|
||||
delete result;
|
||||
result = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
void _STLP_CALL ios_base::_S_initialize()
|
||||
{
|
||||
|
||||
if (ios_base::Init::_S_count > 0)
|
||||
return ;
|
||||
# if !defined(_STLP_HAS_NO_NAMESPACES) && !defined(_STLP_WINCE)
|
||||
using _SgI::stdio_istreambuf;
|
||||
using _SgI::stdio_ostreambuf;
|
||||
# endif
|
||||
_STLP_TRY {
|
||||
// Run constructors for the four narrow stream objects.
|
||||
// check with locale system
|
||||
if (_Loc_init::_S_count == 0) {
|
||||
locale::_S_initialize();
|
||||
}
|
||||
#if !defined(_STLP_WINCE)
|
||||
istream* ptr_cin = new((void*)&cin) istream(0);
|
||||
ostream* ptr_cout = new((void*)&cout) ostream(0);
|
||||
ostream* ptr_cerr = new((void*)&cerr) ostream(0);
|
||||
ostream* ptr_clog = new((void*)&clog) ostream(0);
|
||||
|
||||
// Initialize the four narrow stream objects.
|
||||
if (_S_was_synced) {
|
||||
ptr_cin->init(new stdio_istreambuf(stdin));
|
||||
ptr_cout->init(new stdio_ostreambuf(stdout));
|
||||
ptr_cerr->init(new stdio_ostreambuf(stderr));
|
||||
ptr_clog->init(new stdio_ostreambuf(stderr));
|
||||
} else {
|
||||
ptr_cin->init(_Stl_create_filebuf(stdin, ios_base::in));
|
||||
ptr_cin->init(_Stl_create_filebuf(stdout, ios_base::out));
|
||||
ptr_cin->init(_Stl_create_filebuf(stderr, ios_base::out));
|
||||
ptr_cin->init(_Stl_create_filebuf(stderr, ios_base::out));
|
||||
}
|
||||
ptr_cin->tie(ptr_cout);
|
||||
ptr_cerr->setf(ios_base::unitbuf);
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
// Run constructors for the four wide stream objects.
|
||||
wistream* ptr_wcin = new(&wcin) wistream(0);
|
||||
wostream* ptr_wcout = new(&wcout) wostream(0);
|
||||
wostream* ptr_wcerr = new(&wcerr) wostream(0);
|
||||
wostream* ptr_wclog = new(&wclog) wostream(0);
|
||||
|
||||
wfilebuf* win = _Stl_create_wfilebuf(stdin, ios_base::in);
|
||||
wfilebuf* wout = _Stl_create_wfilebuf(stdout, ios_base::out);;
|
||||
wfilebuf* werr = _Stl_create_wfilebuf(stderr, ios_base::out);
|
||||
wfilebuf* wlog = _Stl_create_wfilebuf(stderr, ios_base::out);
|
||||
|
||||
ptr_wcin->init(win);
|
||||
ptr_wcout->init(wout);
|
||||
ptr_wcerr->init(werr);
|
||||
ptr_wclog->init(wlog);
|
||||
|
||||
ptr_wcin->tie(ptr_wcout);
|
||||
ptr_wcerr->setf(ios_base::unitbuf);
|
||||
|
||||
# endif /* _STLP_NO_WCHAR_T */
|
||||
#endif /* _STLP_WINCE */
|
||||
|
||||
--ios_base::Init::_S_count;
|
||||
}
|
||||
|
||||
_STLP_CATCH_ALL {}
|
||||
}
|
||||
|
||||
void _STLP_CALL ios_base::_S_uninitialize()
|
||||
{
|
||||
if (ios_base::Init::_S_count == 0)
|
||||
return ;
|
||||
|
||||
// Note that destroying output streambufs flushes the buffers.
|
||||
|
||||
istream* ptr_cin = __REINTERPRET_CAST(istream*,&cin);
|
||||
ostream* ptr_cout = __REINTERPRET_CAST(ostream*,&cout);
|
||||
ostream* ptr_cerr = __REINTERPRET_CAST(ostream*,&cerr);
|
||||
ostream* ptr_clog = __REINTERPRET_CAST(ostream*,&clog);
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wistream* ptr_wcin = __REINTERPRET_CAST(wistream*,&wcin);
|
||||
wostream* ptr_wcout = __REINTERPRET_CAST(wostream*,&wcout);
|
||||
wostream* ptr_wcerr = __REINTERPRET_CAST(wostream*,&wcerr);
|
||||
wostream* ptr_wclog = __REINTERPRET_CAST(wostream*,&wclog);
|
||||
# endif
|
||||
|
||||
// we don't want any exceptions being thrown here
|
||||
ptr_cin->exceptions(0);
|
||||
ptr_cout->exceptions(0);
|
||||
ptr_cerr->exceptions(0);
|
||||
ptr_clog->exceptions(0);
|
||||
|
||||
delete ptr_cin->rdbuf(0);
|
||||
delete ptr_cout->rdbuf(0);
|
||||
delete ptr_cerr->rdbuf(0);
|
||||
delete ptr_clog->rdbuf(0);
|
||||
|
||||
_Destroy(ptr_cin);
|
||||
_Destroy(ptr_cout);
|
||||
_Destroy(ptr_cerr);
|
||||
_Destroy(ptr_clog);
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
// we don't want any exceptions being thrown here
|
||||
ptr_wcin->exceptions(0);
|
||||
ptr_wcout->exceptions(0);
|
||||
ptr_wcerr->exceptions(0);
|
||||
ptr_wclog->exceptions(0);
|
||||
|
||||
delete ptr_wcin->rdbuf(0);
|
||||
delete ptr_wcout->rdbuf(0);
|
||||
delete ptr_wcerr->rdbuf(0);
|
||||
delete ptr_wclog->rdbuf(0);
|
||||
|
||||
_Destroy(ptr_wcin);
|
||||
_Destroy(ptr_wcout);
|
||||
_Destroy(ptr_wcerr);
|
||||
_Destroy(ptr_wclog);
|
||||
|
||||
# endif
|
||||
if (_Loc_init::_S_count > 0) {
|
||||
locale::_S_uninitialize();
|
||||
}
|
||||
|
||||
--ios_base::Init::_S_count;
|
||||
}
|
||||
|
||||
|
||||
bool _STLP_CALL ios_base::sync_with_stdio(bool sync) {
|
||||
#if !defined(STLP_WINCE)
|
||||
# ifndef _STLP_HAS_NO_NAMESPACES
|
||||
using _SgI::stdio_istreambuf;
|
||||
using _SgI::stdio_ostreambuf;
|
||||
# endif
|
||||
|
||||
bool was_synced = _S_was_synced;
|
||||
|
||||
// if by any chance we got there before std streams initialization,
|
||||
// just set the sync flag and exit
|
||||
if (Init::_S_count == 0) {
|
||||
_S_was_synced = sync;
|
||||
return was_synced;
|
||||
}
|
||||
|
||||
istream* ptr_cin = __REINTERPRET_CAST(istream*,&cin);
|
||||
ostream* ptr_cout = __REINTERPRET_CAST(ostream*,&cout);
|
||||
ostream* ptr_cerr = __REINTERPRET_CAST(ostream*,&cerr);
|
||||
ostream* ptr_clog = __REINTERPRET_CAST(ostream*,&clog);
|
||||
|
||||
streambuf* old_cin = ptr_cin->rdbuf();
|
||||
streambuf* old_cout = ptr_cout->rdbuf();
|
||||
streambuf* old_cerr = ptr_cerr->rdbuf();
|
||||
streambuf* old_clog = ptr_clog->rdbuf();
|
||||
|
||||
streambuf* new_cin = 0;
|
||||
streambuf* new_cout = 0;
|
||||
streambuf* new_cerr = 0;
|
||||
streambuf* new_clog = 0;
|
||||
|
||||
_STLP_TRY {
|
||||
if (sync && !was_synced) {
|
||||
new_cin = new stdio_istreambuf(stdin);
|
||||
new_cout = new stdio_ostreambuf(stdout);
|
||||
new_cerr = new stdio_ostreambuf(stderr);
|
||||
new_clog = new stdio_ostreambuf(stderr);
|
||||
}
|
||||
else if (!sync && was_synced) {
|
||||
new_cin = _Stl_create_filebuf(stdin, ios_base::in);
|
||||
new_cout = _Stl_create_filebuf(stdout, ios_base::out);
|
||||
new_cerr = _Stl_create_filebuf(stderr, ios_base::out);
|
||||
new_clog = _Stl_create_filebuf(stderr, ios_base::out);
|
||||
}
|
||||
}
|
||||
_STLP_CATCH_ALL {}
|
||||
|
||||
if (new_cin && new_cout && new_cerr && new_clog) {
|
||||
ptr_cin->rdbuf(new_cin);
|
||||
ptr_cout->rdbuf(new_cout);
|
||||
ptr_cerr->rdbuf(new_cerr);
|
||||
ptr_clog->rdbuf(new_clog);
|
||||
|
||||
delete old_cin;
|
||||
delete old_cout;
|
||||
delete old_cerr;
|
||||
delete old_clog;
|
||||
}
|
||||
else {
|
||||
delete new_cin;
|
||||
delete new_cout;
|
||||
delete new_cerr;
|
||||
delete new_clog;
|
||||
}
|
||||
|
||||
return was_synced;
|
||||
#else
|
||||
return false;
|
||||
#endif /* _STLP_WINCE */
|
||||
}
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
49
STLPORT/src/istream.cpp
Normal file
49
STLPORT/src/istream.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
#include <istream>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
#if !defined(_STLP_NO_FORCE_INSTANTIATE)
|
||||
// instantiations
|
||||
# if defined (_STLP_USE_TEMPLATE_EXPORT)
|
||||
template class _STLP_CLASS_DECLSPEC _Isentry<char, char_traits<char> >;
|
||||
# endif
|
||||
template class _STLP_CLASS_DECLSPEC basic_iostream<char, char_traits<char> >;
|
||||
#if !defined(_STLP_MSVC) || (_STLP_MSVC > 1100)
|
||||
template class _STLP_CLASS_DECLSPEC basic_istream<char, char_traits<char> >;
|
||||
#endif
|
||||
|
||||
#ifndef _STLP_NO_WCHAR_T
|
||||
# if defined (_STLP_USE_TEMPLATE_EXPORT)
|
||||
template class _STLP_CLASS_DECLSPEC _Isentry<wchar_t, char_traits<wchar_t> >;
|
||||
# endif
|
||||
#if !defined(_STLP_MSVC) || (_STLP_MSVC > 1100)
|
||||
template class _STLP_CLASS_DECLSPEC basic_istream<wchar_t, char_traits<wchar_t> >;
|
||||
#endif
|
||||
template class _STLP_CLASS_DECLSPEC basic_iostream<wchar_t, char_traits<wchar_t> >;
|
||||
#endif /* INSTANTIATE_WIDE_STREAMS */
|
||||
#endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
67
STLPORT/src/kai-sun.mak
Normal file
67
STLPORT/src/kai-sun.mak
Normal file
@@ -0,0 +1,67 @@
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = KCC
|
||||
CXX = $(CC)
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_kcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
|
||||
WARNING_FLAGS= --one_per --thread_safe --exceptions --abstract_pointer
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
LINK=KCC ${CXXFLAGS_COMMON} -o
|
||||
DYN_LINK=KCC ${CXXFLAGS_COMMON} -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=KAI${ARCH}
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: sparc_atomic.o all_static all_dynamic symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) +K3 -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) +K3 -O2 -KPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) +K0
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) +K0 -KPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
sparc_atomic.o : sparc_atomic.s
|
||||
${AS} sparc_atomic.s -o sparc_atomic.o
|
||||
sparc_atomic64.o : sparc_atomic64.s
|
||||
${AS} sparc_atomic64.s -o sparc_atomic64.o
|
||||
|
||||
LDFLAGS_RELEASE_static = ${CXXFLAGS_RELEASE_static}
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic} --soname ${RELEASE_DYNLIB_SONAME} sparc_atomic.o
|
||||
|
||||
LDFLAGS_DEBUG_static = ${CXXFLAGS_DEBUG_static} sparc_atomic.o
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic} --soname ${DEBUG_DYNLIB_SONAME} sparc_atomic.o
|
||||
|
||||
LDFLAGS_STLDEBUG_static = ${CXXFLAGS_STLDEBUG_static} sparc_atomic.o
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic} --soname ${STLDEBUG_DYNLIB_SONAME} sparc_atomic.o
|
||||
|
||||
# LDLIBS_RELEASE_dynamic = -lposix4
|
||||
# LDLIBS_STLDEBUG_dynamic = -lposix4
|
||||
|
||||
|
||||
|
||||
63
STLPORT/src/kai.mak
Normal file
63
STLPORT/src/kai.mak
Normal file
@@ -0,0 +1,63 @@
|
||||
#
|
||||
# compiler
|
||||
#
|
||||
CC = KCC
|
||||
CXX = $(CC)
|
||||
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
LIB_BASENAME = libstlport_kcc
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
|
||||
WARNING_FLAGS= --one_per --thread_safe --exceptions --abstract_pointer
|
||||
|
||||
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
|
||||
|
||||
LINK=ar crv
|
||||
DYN_LINK=KCC ${CXXFLAGS_COMMON} -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=KAI${ARCH}
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: all_static all_dynamic symbolic_links
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) +K3 -O2
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) +K3 -O2 -KPIC
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -K0
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -K0 -KPIC
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
|
||||
LDFLAGS_RELEASE_static = ${CXXFLAGS_RELEASE_static}
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic} --soname ${RELEASE_DYNLIB_SONAME}
|
||||
|
||||
LDFLAGS_DEBUG_static = ${CXXFLAGS_DEBUG_static}
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic} --soname ${DEBUG_DYNLIB_SONAME}
|
||||
|
||||
LDFLAGS_STLDEBUG_static = ${CXXFLAGS_STLDEBUG_static} sparc_atomic.S
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic} --soname ${STLDEBUG_DYNLIB_SONAME}
|
||||
|
||||
LDLIBS_RELEASE_dynamic = -lposix4
|
||||
LDLIBS_STLDEBUG_dynamic = -lposix4
|
||||
|
||||
|
||||
|
||||
120
STLPORT/src/locale.cpp
Normal file
120
STLPORT/src/locale.cpp
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
#include <locale>
|
||||
#include <stdexcept>
|
||||
#include <stl/_algobase.h>
|
||||
|
||||
#include "locale_nonclassic.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
_Locale::_Locale(const _Locale_impl& L)
|
||||
: _Locale_impl(L), _Refcount_Base(1), facets_vec((void**)L.facets, (void**)L.facets+L.size())
|
||||
{
|
||||
for (size_t i = 1; i < L.size(); ++i) {
|
||||
locale::facet* f = L.facets[i];
|
||||
if (f && f->_M_delete)
|
||||
f->_M_incr();
|
||||
}
|
||||
facets = (locale::facet**)&facets_vec[0];
|
||||
_M_size = facets_vec.size();
|
||||
}
|
||||
|
||||
_Locale::~_Locale() {
|
||||
size_t sz = facets_vec.size();
|
||||
for (size_t i = 1; i < sz ; ++i)
|
||||
this->remove(i);
|
||||
}
|
||||
|
||||
void _Locale::remove(size_t index) {
|
||||
if (index > 0 && index < facets_vec.size()) {
|
||||
locale::facet* old = (locale::facet*)facets_vec[index];
|
||||
if (old && old->_M_delete) {
|
||||
old->_M_decr();
|
||||
if (old->_M_ref_count == 0)
|
||||
delete old;
|
||||
}
|
||||
facets_vec[index] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
locale::facet*
|
||||
_Locale::insert(locale::facet* f, size_t index, bool do_incr) {
|
||||
if (f != 0 && index != 0) {
|
||||
if (index >= facets_vec.size()) {
|
||||
facets_vec.insert(facets_vec.end(),
|
||||
index - facets_vec.size() + 1, (void*) 0);
|
||||
facets = (locale::facet**)&facets_vec[0];
|
||||
_M_size = facets_vec.size();
|
||||
}
|
||||
if (do_incr)
|
||||
f->_M_incr();
|
||||
|
||||
remove(index);
|
||||
facets_vec[index] = (void*)f;
|
||||
return f;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _Locale::insert(_Locale_impl* from, const locale::id& n) {
|
||||
size_t index = n._M_index;
|
||||
this->remove(index);
|
||||
if (index > 0 && index < from->size())
|
||||
this->insert(from->facets[index], index, true);
|
||||
}
|
||||
|
||||
|
||||
static _STLP_STATIC_MUTEX _Index_lock _STLP_MUTEX_INITIALIZER;
|
||||
|
||||
// Takes a reference to a locale::id, and returns its numeric index.
|
||||
// If no numeric index has yet been assigned, assigns one. The return
|
||||
// value is always positive.
|
||||
static size_t _Stl_loc_get_index(locale::id& id)
|
||||
{
|
||||
if (id._M_index == 0) {
|
||||
_STLP_auto_lock sentry(_Index_lock);
|
||||
size_t new_index = locale::id::_S_max++;
|
||||
id._M_index = new_index;
|
||||
}
|
||||
return id._M_index;
|
||||
}
|
||||
|
||||
void locale::_M_insert(facet* f, locale::id& n)
|
||||
{
|
||||
if (f)
|
||||
((_Locale*)_M_impl)->insert(f, _Stl_loc_get_index(n), false);
|
||||
}
|
||||
|
||||
|
||||
// Make a locale directly from a _Locale_impl object. If the second argument
|
||||
// is true, we clone the _Locale_impl. If false, we just twiddle pointers.
|
||||
locale::locale(_Locale_impl* impl, bool do_copy)
|
||||
: _M_impl(0)
|
||||
{
|
||||
if (do_copy) {
|
||||
_M_impl = new _Locale(*impl);
|
||||
_M_impl->name = "*";
|
||||
} else
|
||||
_M_impl = _S_copy_impl(impl);
|
||||
}
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
737
STLPORT/src/locale_catalog.cpp
Normal file
737
STLPORT/src/locale_catalog.cpp
Normal file
@@ -0,0 +1,737 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
// #include <locale>
|
||||
#include <hash_map>
|
||||
#include "locale_impl.h"
|
||||
#include "c_locale.h"
|
||||
|
||||
#include "locale_nonclassic.h"
|
||||
|
||||
|
||||
#include <stl/_codecvt.h>
|
||||
#include <stl/_collate.h>
|
||||
#include <stl/_ctype.h>
|
||||
#include <stl/_monetary.h>
|
||||
#include <stl/_time_facets.h>
|
||||
#include <stl/_messages_facets.h>
|
||||
#include <stl/_istream.h>
|
||||
#include <stl/_num_get.h>
|
||||
#include <stl/_num_put.h>
|
||||
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
// those wrappers are needed to avoid extern "C"
|
||||
|
||||
void* _Loc_ctype_create(const char * s)
|
||||
{ return (void*)_Locale_ctype_create(s); }
|
||||
void* _Loc_numeric_create(const char * s)
|
||||
{ return (void*)_Locale_numeric_create(s); }
|
||||
void* _Loc_time_create(const char * s)
|
||||
{ return (void*)_Locale_time_create(s); }
|
||||
void* _Loc_collate_create(const char * s)
|
||||
{ return (void*)_Locale_collate_create(s); }
|
||||
void* _Loc_monetary_create(const char * s)
|
||||
{ return (void*)_Locale_monetary_create(s); }
|
||||
void* _Loc_messages_create(const char * s)
|
||||
{ return (void*)_Locale_messages_create(s); }
|
||||
|
||||
char* _Loc_ctype_name(const void* l, char* s)
|
||||
{ return _Locale_ctype_name(l, s); }
|
||||
char* _Loc_numeric_name(const void* l, char* s)
|
||||
{ return _Locale_numeric_name(l, s); }
|
||||
char* _Loc_time_name(const void* l, char* s)
|
||||
{ return _Locale_time_name(l,s); }
|
||||
char* _Loc_collate_name( const void* l, char* s)
|
||||
{ return _Locale_collate_name(l,s); }
|
||||
char* _Loc_monetary_name(const void* l, char* s)
|
||||
{ return _Locale_monetary_name(l,s); }
|
||||
char* _Loc_messages_name(const void* l, char* s)
|
||||
{ return _Locale_messages_name(l,s); }
|
||||
|
||||
const char* _Loc_ctype_default(char* p) { return _Locale_ctype_default(p); }
|
||||
const char* _Loc_numeric_default(char * p) { return _Locale_numeric_default(p); }
|
||||
const char* _Loc_time_default(char* p) { return _Locale_time_default(p); }
|
||||
const char* _Loc_collate_default(char* p) { return _Locale_collate_default(p); }
|
||||
const char* _Loc_monetary_default(char* p) { return _Locale_monetary_default(p); }
|
||||
const char* _Loc_messages_default(char* p) { return _Locale_messages_default(p); }
|
||||
|
||||
void _Loc_ctype_destroy(void* p) {_Locale_ctype_destroy(p); }
|
||||
void _Loc_numeric_destroy(void* p) {_Locale_numeric_destroy(p); }
|
||||
void _Loc_time_destroy(void* p) {_Locale_time_destroy(p);}
|
||||
void _Loc_collate_destroy(void* p) {_Locale_collate_destroy(p);}
|
||||
void _Loc_monetary_destroy(void* p) {_Locale_monetary_destroy(p);}
|
||||
void _Loc_messages_destroy(void* p) {_Locale_messages_destroy(p);}
|
||||
|
||||
typedef void* (*loc_create_func_t)(const char *);
|
||||
typedef char* (*loc_name_func_t)(const void* l, char* s);
|
||||
typedef void (*loc_destroy_func_t)(void* l);
|
||||
typedef const char* (*loc_default_name_func_t)(char* s);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Acquire and release low-level category objects. The whole point of
|
||||
// this is so that we don't allocate (say) four different _Locale_ctype
|
||||
// objects for a single locale.
|
||||
|
||||
struct __eqstr {
|
||||
bool operator()(const char* s1, const char* s2) const
|
||||
{ return strcmp(s1, s2) == 0; }
|
||||
};
|
||||
|
||||
struct __ptr_hash {
|
||||
size_t operator()(const void* p) const
|
||||
{ return __REINTERPRET_CAST(size_t,p); }
|
||||
};
|
||||
|
||||
template <class _Category_ptr>
|
||||
struct __destroy_fun {
|
||||
typedef void (*_fun_type)(_Category_ptr);
|
||||
_fun_type _M_fun;
|
||||
__destroy_fun(_fun_type __f) : _M_fun(__f) {}
|
||||
void operator()(_Category_ptr __c) { _M_fun(__c); }
|
||||
};
|
||||
|
||||
// Global hash tables for category objects.
|
||||
typedef hash_map<const char*, pair<void*, size_t>, hash<const char*>, __eqstr> Category_Map;
|
||||
|
||||
// Look up a category by name
|
||||
static hash_map<const char*, pair<void*, size_t>, hash<const char*>, __eqstr>* ctype_hash;
|
||||
static hash_map<const char*, pair<void*, size_t>, hash<const char*>, __eqstr>* numeric_hash;
|
||||
static hash_map<const char*, pair<void*, size_t>, hash<const char*>, __eqstr>* time_hash;
|
||||
static hash_map<const char*, pair<void*, size_t>, hash<const char*>, __eqstr>* collate_hash;
|
||||
static hash_map<const char*, pair<void*, size_t>, hash<const char*>, __eqstr>* monetary_hash;
|
||||
static hash_map<const char*, pair<void*, size_t>, hash<const char*>, __eqstr>* messages_hash;
|
||||
|
||||
// We have a single lock for all of the hash tables. We may wish to
|
||||
// replace it with six different locks.
|
||||
/* REFERENCED */
|
||||
_STLP_STATIC_MUTEX __category_hash_lock _STLP_MUTEX_INITIALIZER;
|
||||
|
||||
static void*
|
||||
__acquire_category(const char* name, loc_create_func_t create_obj,
|
||||
loc_default_name_func_t default_obj, Category_Map ** M)
|
||||
{
|
||||
typedef Category_Map::iterator Category_iterator;
|
||||
pair<Category_iterator, bool> result;
|
||||
_STLP_auto_lock sentry(__category_hash_lock);
|
||||
|
||||
typedef const char* key_type;
|
||||
pair<const key_type, pair<void*,size_t> > __e(name, pair<void*,size_t>((void*)0,size_t(0)));
|
||||
|
||||
if (!*M)
|
||||
*M = new Category_Map();
|
||||
|
||||
#if defined(__SC__) //*TY 06/01/2000 - added workaround for SCpp
|
||||
if(!*M) delete *M; //*TY 06/01/2000 - it forgets to generate dtor for Category_Map class. This fake code forces to generate one.
|
||||
#endif //*TY 06/01/2000 -
|
||||
|
||||
// Find what name to look for. Be careful if user requests the default.
|
||||
char buf[_Locale_MAX_SIMPLE_NAME];
|
||||
if (name == 0 || name[0] == 0)
|
||||
name = default_obj(buf);
|
||||
if (name == 0 || name[0] == 0)
|
||||
name = "C";
|
||||
|
||||
// Look for an existing entry with that name.
|
||||
|
||||
result = (*M)->insert_noresize(__e);
|
||||
|
||||
// There was no entry in the map already. Create the category.
|
||||
if (result.second)
|
||||
(*result.first).second.first = create_obj(name);
|
||||
|
||||
// Increment the reference count.
|
||||
++((*result.first).second.second);
|
||||
|
||||
return (*result.first).second.first;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
__release_category(void* cat,
|
||||
loc_destroy_func_t destroy_fun,
|
||||
loc_name_func_t get_name,
|
||||
Category_Map* M)
|
||||
{
|
||||
_STLP_auto_lock sentry(__category_hash_lock);
|
||||
|
||||
if (cat && M) {
|
||||
// Find the name of the category object.
|
||||
char buf[_Locale_MAX_SIMPLE_NAME + 1];
|
||||
char* name = get_name(cat, buf);
|
||||
|
||||
if (name != 0) {
|
||||
Category_Map::iterator it = M->find(name);
|
||||
if (it != M->end()) {
|
||||
// Decrement the ref count. If it goes to zero, delete this category
|
||||
// from the map.
|
||||
if (--((*it).second.second) == 0) {
|
||||
void* cat1 = (*it).second.first;
|
||||
destroy_fun(cat1);
|
||||
M->erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_Locale_ctype* _STLP_CALL __acquire_ctype(const char* name)
|
||||
{ return __REINTERPRET_CAST(_Locale_ctype*,
|
||||
__acquire_category(name, _Loc_ctype_create, _Loc_ctype_default, &ctype_hash)); }
|
||||
_Locale_numeric* _STLP_CALL __acquire_numeric(const char* name)
|
||||
{ return __REINTERPRET_CAST(_Locale_numeric*,
|
||||
__acquire_category(name, _Loc_numeric_create, _Loc_numeric_default, &numeric_hash)); }
|
||||
_Locale_time* _STLP_CALL __acquire_time(const char* name)
|
||||
{ return __REINTERPRET_CAST(_Locale_time*,
|
||||
__acquire_category(name, _Loc_time_create, _Loc_time_default, &time_hash)); }
|
||||
_Locale_collate* _STLP_CALL __acquire_collate(const char* name)
|
||||
{ return __REINTERPRET_CAST(_Locale_collate*,
|
||||
__acquire_category(name, _Loc_collate_create, _Loc_collate_default, &collate_hash)); }
|
||||
_Locale_monetary* _STLP_CALL __acquire_monetary(const char* name)
|
||||
{ return __REINTERPRET_CAST(_Locale_monetary*,
|
||||
__acquire_category(name, _Loc_monetary_create, _Loc_monetary_default, &monetary_hash)); }
|
||||
_Locale_messages* _STLP_CALL __acquire_messages(const char* name)
|
||||
{ return __REINTERPRET_CAST(_Locale_messages*,
|
||||
__acquire_category(name, _Loc_messages_create, _Loc_messages_default, &messages_hash)); }
|
||||
|
||||
void _STLP_CALL __release_ctype(_Locale_ctype* cat) {
|
||||
__release_category(cat, _Loc_ctype_destroy, _Loc_ctype_name, ctype_hash);
|
||||
}
|
||||
void _STLP_CALL __release_numeric(_Locale_numeric* cat) {
|
||||
__release_category(cat, _Loc_numeric_destroy, _Loc_numeric_name, numeric_hash);
|
||||
}
|
||||
void _STLP_CALL __release_time(_Locale_time* cat) {
|
||||
__release_category(cat, _Loc_time_destroy, _Loc_time_name, time_hash);
|
||||
}
|
||||
void _STLP_CALL __release_collate(_Locale_collate* cat) {
|
||||
__release_category(cat, _Loc_collate_destroy, _Loc_collate_name, collate_hash);
|
||||
}
|
||||
void _STLP_CALL __release_monetary(_Locale_monetary* cat) {
|
||||
__release_category(cat, _Loc_monetary_destroy, _Loc_monetary_name, monetary_hash);
|
||||
}
|
||||
void _STLP_CALL __release_messages(_Locale_messages* cat) {
|
||||
__release_category(cat, _Loc_messages_destroy, _Loc_messages_name, messages_hash);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// <locale> content which is dependent on the name
|
||||
//
|
||||
|
||||
template <class Facet>
|
||||
inline locale::facet*
|
||||
_Locale_insert(_Locale* __that, Facet* f) {
|
||||
return __that->insert(f, Facet::id._M_index, false);
|
||||
}
|
||||
|
||||
// Give L a name where all facets except those in category c
|
||||
// are taken from name1, and those in category c are taken from name2.
|
||||
void _Stl_loc_combine_names(_Locale* L,
|
||||
const char* name1, const char* name2,
|
||||
locale::category c)
|
||||
{
|
||||
if ((c & locale::all) == 0 || strcmp(name1, name2) == 0)
|
||||
L->name = name1;
|
||||
else if ((c & locale::all) == locale::all)
|
||||
L->name = name2;
|
||||
else {
|
||||
// Decompose the names.
|
||||
char ctype_buf[_Locale_MAX_SIMPLE_NAME];
|
||||
char numeric_buf[_Locale_MAX_SIMPLE_NAME];
|
||||
char time_buf[_Locale_MAX_SIMPLE_NAME];
|
||||
char collate_buf[_Locale_MAX_SIMPLE_NAME];
|
||||
char monetary_buf[_Locale_MAX_SIMPLE_NAME];
|
||||
char messages_buf[_Locale_MAX_SIMPLE_NAME];
|
||||
|
||||
_Locale_extract_ctype_name((c & locale::ctype) ? name2 : name1,
|
||||
ctype_buf);
|
||||
_Locale_extract_numeric_name((c & locale::numeric) ? name2 : name1,
|
||||
numeric_buf);
|
||||
_Locale_extract_time_name((c & locale::time) ? name2 : name1,
|
||||
time_buf);
|
||||
_Locale_extract_collate_name((c & locale::collate) ? name2 : name1,
|
||||
collate_buf);
|
||||
_Locale_extract_monetary_name((c & locale::monetary) ? name2 : name1,
|
||||
monetary_buf);
|
||||
_Locale_extract_messages_name((c & locale::messages) ? name2 : name1,
|
||||
messages_buf);
|
||||
|
||||
// Construct a new composite name.
|
||||
char composite_buf[_Locale_MAX_COMPOSITE_NAME];
|
||||
_Locale_compose_name(composite_buf,
|
||||
ctype_buf, numeric_buf, time_buf,
|
||||
collate_buf, monetary_buf, messages_buf,
|
||||
name1);
|
||||
L->name = composite_buf;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create a locale from a name.
|
||||
locale::locale(const char* name)
|
||||
: _M_impl(0)
|
||||
{
|
||||
if (!name)
|
||||
_M_throw_runtime_error(0);
|
||||
|
||||
_Locale* impl = 0;
|
||||
|
||||
_STLP_TRY {
|
||||
impl = new _Locale(locale::id::_S_max, name);
|
||||
|
||||
// Insert categories one at a time.
|
||||
impl->insert_ctype_facets(name);
|
||||
impl->insert_numeric_facets(name);
|
||||
impl->insert_time_facets(name);
|
||||
impl->insert_collate_facets(name);
|
||||
impl->insert_monetary_facets(name);
|
||||
impl->insert_messages_facets(name);
|
||||
// reassign impl
|
||||
_M_impl = impl;
|
||||
}
|
||||
_STLP_UNWIND(delete impl);
|
||||
}
|
||||
|
||||
// Create a locale that's a copy of L, except that all of the facets
|
||||
// in category c are instead constructed by name.
|
||||
locale::locale(const locale& L, const char* name, locale::category c)
|
||||
: _M_impl(0)
|
||||
{
|
||||
if (name == 0 || strcmp(name, "*") == 0)
|
||||
_M_throw_runtime_error(name);
|
||||
|
||||
_Locale* impl = 0;
|
||||
|
||||
_STLP_TRY {
|
||||
impl = new _Locale(*L._M_impl);
|
||||
_Stl_loc_combine_names(impl, L._M_impl->name.c_str(), name, c);
|
||||
|
||||
if (c & locale::ctype)
|
||||
impl->insert_ctype_facets(name);
|
||||
if (c & locale::numeric)
|
||||
impl->insert_numeric_facets(name);
|
||||
if (c & locale::time)
|
||||
impl->insert_time_facets(name);
|
||||
if (c & locale::collate)
|
||||
impl->insert_collate_facets(name);
|
||||
if (c & locale::monetary)
|
||||
impl->insert_monetary_facets(name);
|
||||
if (c & locale::messages)
|
||||
impl->insert_messages_facets(name);
|
||||
_M_impl = impl;
|
||||
}
|
||||
_STLP_UNWIND(delete impl)
|
||||
|
||||
}
|
||||
|
||||
// Contruct a new locale where all facets that aren't in category c
|
||||
// come from L1, and all those that are in category c come from L2.
|
||||
locale::locale(const locale& L1, const locale& L2, category c)
|
||||
: _M_impl(0)
|
||||
{
|
||||
_Locale* impl = new _Locale(*L1._M_impl);
|
||||
|
||||
_Locale_impl* i2 = L2._M_impl;
|
||||
|
||||
static string nameless("*");
|
||||
if (L1.name() != nameless && L2.name() != nameless)
|
||||
_Stl_loc_combine_names(impl,
|
||||
L1._M_impl->name.c_str(), L2._M_impl->name.c_str(),
|
||||
c);
|
||||
else {
|
||||
impl->name = "*";
|
||||
}
|
||||
|
||||
if (c & collate) {
|
||||
impl->insert( i2, _STLP_STD::collate<char>::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
impl->insert( i2, _STLP_STD::collate<wchar_t>::id);
|
||||
# endif
|
||||
}
|
||||
if (c & ctype) {
|
||||
impl->insert( i2, _STLP_STD::ctype<char>::id);
|
||||
impl->insert( i2, _STLP_STD::codecvt<char, char, mbstate_t>::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
impl->insert( i2, _STLP_STD::ctype<wchar_t>::id);
|
||||
impl->insert( i2, _STLP_STD::codecvt<wchar_t, char, mbstate_t>::id);
|
||||
# endif
|
||||
}
|
||||
if (c & monetary) {
|
||||
impl->insert( i2, _STLP_STD::moneypunct<char, true>::id);
|
||||
impl->insert( i2, _STLP_STD::moneypunct<char, false>::id);
|
||||
impl->insert( i2, _STLP_STD::money_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
|
||||
impl->insert( i2, _STLP_STD::money_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
impl->insert( i2, _STLP_STD::moneypunct<wchar_t, true>::id);
|
||||
impl->insert( i2, _STLP_STD::moneypunct<wchar_t, false>::id);
|
||||
impl->insert( i2, _STLP_STD::money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
impl->insert( i2, _STLP_STD::money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
# endif
|
||||
}
|
||||
if (c & numeric) {
|
||||
impl->insert( i2, _STLP_STD::numpunct<char>::id);
|
||||
impl->insert( i2, _STLP_STD::num_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
|
||||
impl->insert( i2, _STLP_STD::num_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
impl->insert( i2, _STLP_STD::numpunct<wchar_t>::id);
|
||||
impl->insert( i2, num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
impl->insert( i2, num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
# endif
|
||||
}
|
||||
if (c & time) {
|
||||
impl->insert( i2, _STLP_STD::time_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
|
||||
impl->insert( i2, _STLP_STD::time_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
impl->insert( i2, _STLP_STD::time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
impl->insert( i2, _STLP_STD::time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
# endif
|
||||
}
|
||||
if (c & messages) {
|
||||
impl->insert( i2, _STLP_STD::messages<char>::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
impl->insert( i2, _STLP_STD::messages<wchar_t>::id);
|
||||
# endif
|
||||
}
|
||||
_M_impl = impl;
|
||||
}
|
||||
|
||||
// Six functions, one for each category. Each of them takes a
|
||||
// _Locale* and a name, constructs that appropriate category
|
||||
// facets by name, and inserts them into the locale.
|
||||
|
||||
void _Locale::insert_ctype_facets(const char* pname)
|
||||
{
|
||||
char buf[_Locale_MAX_SIMPLE_NAME];
|
||||
_Locale_impl* i2 = locale::classic()._M_impl;
|
||||
|
||||
if (pname == 0 || pname[0] == 0)
|
||||
pname = _Locale_ctype_default(buf);
|
||||
|
||||
if (pname == 0 || pname[0] == 0 || strcmp(pname, "C") == 0) {
|
||||
this->insert(i2, ctype<char>::id);
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
this->insert(i2, codecvt<char, char, mbstate_t>::id);
|
||||
# endif
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
this->insert(i2, ctype<wchar_t>::id);
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
this->insert(i2, codecvt<wchar_t, char, mbstate_t>::id);
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
else {
|
||||
ctype<char>* ct = 0;
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
codecvt<char, char, mbstate_t>* cvt = 0;
|
||||
# endif
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
ctype<wchar_t>* wct = 0;
|
||||
codecvt<wchar_t, char, mbstate_t>* wcvt = 0;
|
||||
# endif
|
||||
_STLP_TRY {
|
||||
ct = new ctype_byname<char>(pname);
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
cvt = new codecvt_byname<char, char, mbstate_t>(pname);
|
||||
# endif
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wct = new ctype_byname<wchar_t>(pname);
|
||||
wcvt = new codecvt_byname<wchar_t, char, mbstate_t>(pname);
|
||||
# endif
|
||||
}
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
# ifdef _STLP_NO_MBSTATE_T
|
||||
_STLP_UNWIND(delete ct; delete wct; delete wcvt);
|
||||
# else
|
||||
_STLP_UNWIND(delete ct; delete wct; delete cvt; delete wcvt);
|
||||
# endif
|
||||
# else
|
||||
# ifdef _STLP_NO_MBSTATE_T
|
||||
_STLP_UNWIND(delete ct);
|
||||
# else
|
||||
_STLP_UNWIND(delete ct; delete cvt);
|
||||
# endif
|
||||
# endif
|
||||
_Locale_insert(this, ct);
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
_Locale_insert(this, cvt);
|
||||
# endif
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_Locale_insert(this, wct);
|
||||
_Locale_insert(this, wcvt);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
void _Locale::insert_numeric_facets(const char* pname)
|
||||
{
|
||||
_Locale_impl* i2 = locale::classic()._M_impl;
|
||||
|
||||
numpunct<char>* punct = 0;
|
||||
num_get<char, istreambuf_iterator<char, char_traits<char> > >* get = 0;
|
||||
num_put<char, ostreambuf_iterator<char, char_traits<char> > >* put = 0;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
numpunct<wchar_t>* wpunct = 0;
|
||||
num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >* wget = 0;
|
||||
num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >* wput = 0;
|
||||
# endif
|
||||
|
||||
char buf[_Locale_MAX_SIMPLE_NAME];
|
||||
if (pname == 0 || pname[0] == 0)
|
||||
pname = _Locale_numeric_default(buf);
|
||||
|
||||
if (pname == 0 || pname[0] == 0 || strcmp(pname, "C") == 0) {
|
||||
this->insert(i2, numpunct<char>::id);
|
||||
this->insert(i2,
|
||||
num_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
|
||||
this->insert(i2,
|
||||
num_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
this->insert(i2, numpunct<wchar_t>::id);
|
||||
this->insert(i2,
|
||||
num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
this->insert(i2,
|
||||
num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
# endif
|
||||
}
|
||||
else {
|
||||
_STLP_TRY {
|
||||
punct = new numpunct_byname<char>(pname);
|
||||
get = new num_get<char, istreambuf_iterator<char, char_traits<char> > >;
|
||||
put = new num_put<char, ostreambuf_iterator<char, char_traits<char> > >;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wpunct = new numpunct_byname<wchar_t>(pname);
|
||||
wget = new num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
||||
wput = new num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
||||
# endif
|
||||
}
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_STLP_UNWIND(delete punct; delete wpunct; delete get; delete wget;
|
||||
delete put; delete wput);
|
||||
# else
|
||||
_STLP_UNWIND(delete punct; delete get;delete put);
|
||||
# endif
|
||||
|
||||
_Locale_insert(this,punct);
|
||||
_Locale_insert(this,get);
|
||||
_Locale_insert(this,put);
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_Locale_insert(this,wpunct);
|
||||
_Locale_insert(this,wget);
|
||||
_Locale_insert(this,wput);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
void _Locale::insert_time_facets(const char* pname)
|
||||
{
|
||||
_Locale_impl* i2 = locale::classic()._M_impl;
|
||||
time_get<char, istreambuf_iterator<char, char_traits<char> > >* get = 0;
|
||||
time_put<char, ostreambuf_iterator<char, char_traits<char> > >* put = 0;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >* wget = 0;
|
||||
time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >* wput = 0;
|
||||
# endif
|
||||
|
||||
char buf[_Locale_MAX_SIMPLE_NAME];
|
||||
if (pname == 0 || pname[0] == 0)
|
||||
pname = _Locale_time_default(buf);
|
||||
|
||||
if (pname == 0 || pname[0] == 0 || strcmp(pname, "C") == 0) {
|
||||
|
||||
this->insert(i2,
|
||||
time_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
|
||||
this->insert(i2,
|
||||
time_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
this->insert(i2,
|
||||
time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
this->insert(i2,
|
||||
time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
# endif
|
||||
}
|
||||
else {
|
||||
_STLP_TRY {
|
||||
get = new time_get_byname<char, istreambuf_iterator<char, char_traits<char> > >(pname);
|
||||
put = new time_put_byname<char, ostreambuf_iterator<char, char_traits<char> > >(pname);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wget = new time_get_byname<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >(pname);
|
||||
wput = new time_put_byname<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >(pname);
|
||||
# endif
|
||||
}
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_STLP_UNWIND(delete get; delete wget; delete put; delete wput);
|
||||
# else
|
||||
_STLP_UNWIND(delete get; delete put);
|
||||
# endif
|
||||
_Locale_insert(this,get);
|
||||
_Locale_insert(this,put);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_Locale_insert(this,wget);
|
||||
_Locale_insert(this,wput);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
void _Locale::insert_collate_facets(const char* nam)
|
||||
{
|
||||
_Locale_impl* i2 = locale::classic()._M_impl;
|
||||
|
||||
collate<char>* col = 0;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
collate<wchar_t>* wcol = 0;
|
||||
# endif
|
||||
|
||||
char buf[_Locale_MAX_SIMPLE_NAME];
|
||||
if (nam == 0 || nam[0] == 0)
|
||||
nam = _Locale_collate_default(buf);
|
||||
|
||||
if (nam == 0 || nam[0] == 0 || strcmp(nam, "C") == 0) {
|
||||
this->insert(i2, collate<char>::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
this->insert(i2, collate<wchar_t>::id);
|
||||
# endif
|
||||
}
|
||||
else {
|
||||
_STLP_TRY {
|
||||
col = new collate_byname<char>(nam);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wcol = new collate_byname<wchar_t>(nam);
|
||||
# endif
|
||||
}
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_STLP_UNWIND(delete col; delete wcol);
|
||||
# else
|
||||
_STLP_UNWIND(delete col);
|
||||
# endif
|
||||
_Locale_insert(this,col);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_Locale_insert(this,wcol);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
void _Locale::insert_monetary_facets(const char* pname)
|
||||
{
|
||||
_Locale_impl* i2 = locale::classic()._M_impl;
|
||||
|
||||
moneypunct<char, false>* punct = 0;
|
||||
moneypunct<char, true>* ipunct = 0;
|
||||
money_get<char, istreambuf_iterator<char, char_traits<char> > >* get = 0;
|
||||
money_put<char, ostreambuf_iterator<char, char_traits<char> > >* put = 0;
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
moneypunct<wchar_t, false>* wpunct = 0;
|
||||
moneypunct<wchar_t, true>* wipunct = 0;
|
||||
money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >* wget = 0;
|
||||
money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >* wput = 0;
|
||||
# endif
|
||||
|
||||
char buf[_Locale_MAX_SIMPLE_NAME];
|
||||
if (pname == 0 || pname[0] == 0)
|
||||
pname = _Locale_monetary_default(buf);
|
||||
|
||||
if (pname == 0 || pname[0] == 0 || strcmp(pname, "C") == 0) {
|
||||
this->insert(i2, moneypunct<char, false>::id);
|
||||
this->insert(i2, moneypunct<char, true>::id);
|
||||
this->insert(i2, money_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
|
||||
this->insert(i2, money_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
this->insert(i2, moneypunct<wchar_t, false>::id);
|
||||
this->insert(i2, moneypunct<wchar_t, true>::id);
|
||||
this->insert(i2, money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
this->insert(i2, money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
|
||||
# endif
|
||||
}
|
||||
else {
|
||||
_STLP_TRY {
|
||||
punct = new moneypunct_byname<char, false>(pname);
|
||||
ipunct = new moneypunct_byname<char, true>(pname);
|
||||
get = new money_get<char, istreambuf_iterator<char, char_traits<char> > >;
|
||||
put = new money_put<char, ostreambuf_iterator<char, char_traits<char> > >;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wpunct = new moneypunct_byname<wchar_t, false>(pname);
|
||||
wipunct = new moneypunct_byname<wchar_t, true>(pname);
|
||||
wget = new money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
||||
wput = new money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
||||
# endif
|
||||
}
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_STLP_UNWIND(delete punct; delete ipunct; delete wpunct; delete wipunct;
|
||||
delete get; delete wget; delete put; delete wput);
|
||||
# else
|
||||
_STLP_UNWIND(delete punct; delete ipunct; delete get; delete put);
|
||||
# endif
|
||||
_Locale_insert(this,punct);
|
||||
_Locale_insert(this,ipunct);
|
||||
_Locale_insert(this,get);
|
||||
_Locale_insert(this,put);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_Locale_insert(this,wget);
|
||||
_Locale_insert(this,wpunct);
|
||||
_Locale_insert(this,wipunct);
|
||||
_Locale_insert(this,wput);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _Locale::insert_messages_facets(const char* pname)
|
||||
{
|
||||
_Locale_impl* i2 = locale::classic()._M_impl;
|
||||
messages<char>* msg = 0;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
messages<wchar_t>* wmsg = 0;
|
||||
# endif
|
||||
|
||||
char buf[_Locale_MAX_SIMPLE_NAME];
|
||||
if (pname == 0 || pname[0] == 0)
|
||||
pname = _Locale_messages_default(buf);
|
||||
|
||||
if (pname == 0 || pname[0] == 0 || strcmp(pname, "C") == 0) {
|
||||
this->insert(i2, messages<char>::id);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
this->insert(i2, messages<wchar_t>::id);
|
||||
# endif
|
||||
}
|
||||
else {
|
||||
_STLP_TRY {
|
||||
msg = new messages_byname<char>(pname);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wmsg = new messages_byname<wchar_t>(pname);
|
||||
# endif
|
||||
}
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_STLP_UNWIND(delete msg; delete wmsg);
|
||||
# else
|
||||
_STLP_UNWIND(delete msg);
|
||||
# endif
|
||||
_Locale_insert(this,msg);
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_Locale_insert(this,wmsg);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
|
||||
|
||||
485
STLPORT/src/locale_impl.cpp
Normal file
485
STLPORT/src/locale_impl.cpp
Normal file
@@ -0,0 +1,485 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
#include "locale_impl.h"
|
||||
#include <locale>
|
||||
#include <typeinfo>
|
||||
#include <stdexcept>
|
||||
#include "c_locale.h"
|
||||
#include "aligned_buffer.h"
|
||||
|
||||
|
||||
#include "locale_impl.h"
|
||||
#include <stl/_codecvt.h>
|
||||
#include <stl/_collate.h>
|
||||
#include <stl/_ctype.h>
|
||||
#include <stl/_monetary.h>
|
||||
#include "message_facets.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
// #ifdef _STLP_USE_OWN_NAMESPACE
|
||||
// using _STLP_VENDOR_EXCEPT_STD::bad_cast;
|
||||
// #endif
|
||||
|
||||
_Locale_impl::_Locale_impl(const char* s) : name(s) {}
|
||||
_Locale_impl::~_Locale_impl() {}
|
||||
void _Locale_impl::incr() {}
|
||||
void _Locale_impl::decr() {}
|
||||
|
||||
// _Locale_impl non-inline member functions.
|
||||
void _STLP_CALL
|
||||
_Locale_impl::_M_throw_bad_cast()
|
||||
{
|
||||
_STLP_THROW(bad_cast());
|
||||
}
|
||||
|
||||
static void
|
||||
_Stl_loc_assign_ids() {
|
||||
// This assigns ids to every facet that is a member of a category,
|
||||
// and also to money_get/put, num_get/put, and time_get/put
|
||||
// instantiated using ordinary pointers as the input/output
|
||||
// iterators. (The default is [io]streambuf_iterator.)
|
||||
|
||||
money_get<char, istreambuf_iterator<char, char_traits<char> > >::id._M_index = 8;
|
||||
money_get<char, const char*>::id._M_index = 9;
|
||||
money_put<char, ostreambuf_iterator<char, char_traits<char> > >::id._M_index = 10;
|
||||
money_put<char, char*>::id._M_index = 11;
|
||||
|
||||
num_get<char, istreambuf_iterator<char, char_traits<char> > >::id._M_index = 12;
|
||||
num_get<char, const char*>::id._M_index = 13;
|
||||
num_put<char, ostreambuf_iterator<char, char_traits<char> > >::id._M_index = 14;
|
||||
num_put<char, char*>::id._M_index = 15;
|
||||
time_get<char, istreambuf_iterator<char, char_traits<char> > >::id._M_index = 16;
|
||||
time_get<char, const char*>::id._M_index = 17;
|
||||
time_put<char, ostreambuf_iterator<char, char_traits<char> > >::id._M_index = 18;
|
||||
time_put<char, char*>::id._M_index = 19;
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id._M_index = 27;
|
||||
money_get<wchar_t, const wchar_t*>::id._M_index = 28;
|
||||
money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id._M_index = 29;
|
||||
money_put<wchar_t, wchar_t*>::id._M_index = 30;
|
||||
|
||||
num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id._M_index = 31;
|
||||
num_get<wchar_t, const wchar_t*>::id._M_index = 32;
|
||||
num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > > ::id._M_index = 33;
|
||||
num_put<wchar_t, wchar_t*>::id._M_index = 34;
|
||||
time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id._M_index = 35;
|
||||
time_get<wchar_t, const wchar_t*>::id._M_index = 36;
|
||||
time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id._M_index = 37;
|
||||
time_put<wchar_t, wchar_t*>::id._M_index = 38;
|
||||
// messages<wchar_t>::id._M_index = 38;
|
||||
# endif
|
||||
|
||||
// locale::id::_S_max = 39;
|
||||
}
|
||||
|
||||
static _Stl_aligned_buffer<_Locale_impl> _S_classic_locale;
|
||||
|
||||
static _Stl_aligned_buffer<collate<char> > _S_collate_char;
|
||||
static _Stl_aligned_buffer<ctype<char> > _S_ctype_char;
|
||||
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
static _Stl_aligned_buffer<codecvt<char, char, mbstate_t> > _S_codecvt_char;
|
||||
# endif
|
||||
|
||||
static _Stl_aligned_buffer<moneypunct<char, true> > _S_moneypunct_true_char;
|
||||
static _Stl_aligned_buffer<moneypunct<char, false> > _S_moneypunct_false_char;
|
||||
static _Stl_aligned_buffer<numpunct<char> > _S_numpunct_char;
|
||||
static _Stl_aligned_buffer<messages<char> > _S_messages_char;
|
||||
|
||||
static _Stl_aligned_buffer<money_get<char, istreambuf_iterator<char, char_traits<char> > > > _S_money_get_char;
|
||||
static _Stl_aligned_buffer<money_put<char, ostreambuf_iterator<char, char_traits<char> > > > _S_money_put_char;
|
||||
static _Stl_aligned_buffer<num_get<char, istreambuf_iterator<char, char_traits<char> > > > _S_num_get_char;
|
||||
static _Stl_aligned_buffer<num_put<char, ostreambuf_iterator<char, char_traits<char> > > > _S_num_put_char;
|
||||
static _Stl_aligned_buffer<time_get<char, istreambuf_iterator<char, char_traits<char> > > > _S_time_get_char;
|
||||
static _Stl_aligned_buffer<time_put<char, ostreambuf_iterator<char, char_traits<char> > > > _S_time_put_char;
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
static _Stl_aligned_buffer<collate<wchar_t> > _S_collate_wchar;
|
||||
static _Stl_aligned_buffer<ctype<wchar_t> > _S_ctype_wchar;
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
static _Stl_aligned_buffer<codecvt<wchar_t, char, mbstate_t> > _S_codecvt_wchar;
|
||||
# endif
|
||||
static _Stl_aligned_buffer<moneypunct<wchar_t, true> > _S_moneypunct_true_wchar;
|
||||
static _Stl_aligned_buffer<moneypunct<wchar_t, false> > _S_moneypunct_false_wchar;
|
||||
static _Stl_aligned_buffer<numpunct<wchar_t> > _S_numpunct_wchar;
|
||||
static _Stl_aligned_buffer<messages<wchar_t> > _S_messages_wchar;
|
||||
|
||||
static _Stl_aligned_buffer<money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > > > _S_money_get_wchar;
|
||||
static _Stl_aligned_buffer<money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > > > _S_money_put_wchar;
|
||||
static _Stl_aligned_buffer<num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > > > _S_num_get_wchar;
|
||||
static _Stl_aligned_buffer<num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > > > _S_num_put_wchar;
|
||||
static _Stl_aligned_buffer<time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > > > _S_time_get_wchar;
|
||||
static _Stl_aligned_buffer<time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > > > _S_time_put_wchar;
|
||||
|
||||
# endif
|
||||
|
||||
static _Messages _Null_messages;
|
||||
|
||||
static locale::facet* _S_classic_facets[] = {
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_collate_char),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_ctype_char),
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_codecvt_char),
|
||||
# else
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
# endif
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_moneypunct_true_char),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_moneypunct_false_char),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_numpunct_char),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_messages_char),
|
||||
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_money_get_char),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_money_put_char),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_num_get_char),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_num_put_char),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_time_get_char),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_time_put_char),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_collate_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_ctype_wchar),
|
||||
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_codecvt_wchar),
|
||||
# else
|
||||
__REINTERPRET_CAST(locale::facet*,0)
|
||||
# endif
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_moneypunct_true_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_moneypunct_false_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_numpunct_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_messages_wchar),
|
||||
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_money_get_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_money_put_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_num_get_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_num_put_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_time_get_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
__REINTERPRET_CAST(locale::facet*,&_S_time_put_wchar),
|
||||
__REINTERPRET_CAST(locale::facet*,0),
|
||||
# endif
|
||||
0
|
||||
};
|
||||
|
||||
_Locale_impl*
|
||||
_Locale_impl::make_classic_locale() {
|
||||
// The classic locale contains every facet that belongs to a category.
|
||||
_Locale_impl* classic = __REINTERPRET_CAST(_Locale_impl*, &_S_classic_locale);
|
||||
|
||||
new (classic) _Locale_impl("C");
|
||||
|
||||
classic->facets = _S_classic_facets;
|
||||
classic->_M_size = locale::id::_S_max;
|
||||
|
||||
// ctype category
|
||||
new(&_S_ctype_char) ctype<char>(0, false, 1);
|
||||
// collate category
|
||||
new(&_S_collate_char) collate<char>(1);
|
||||
new(&_S_codecvt_char) codecvt<char, char, mbstate_t>(1);
|
||||
// numeric category
|
||||
new(&_S_numpunct_char) numpunct<char>(1);
|
||||
new (&_S_num_get_char) num_get<char, istreambuf_iterator<char, char_traits<char> > >(1);
|
||||
new (&_S_num_put_char) num_put<char, ostreambuf_iterator<char, char_traits<char> > >(1);
|
||||
new (&_S_time_get_char) time_get<char, istreambuf_iterator<char, char_traits<char> > >(1);
|
||||
new (&_S_time_put_char) time_put<char, ostreambuf_iterator<char, char_traits<char> > >(1);
|
||||
// monetary category
|
||||
new (&_S_moneypunct_true_char) moneypunct<char, true>(1);
|
||||
new (&_S_moneypunct_false_char) moneypunct<char, false>(1);
|
||||
new (&_S_money_get_char) money_get<char, istreambuf_iterator<char, char_traits<char> > >(1);
|
||||
new (&_S_money_put_char) money_put<char, ostreambuf_iterator<char, char_traits<char> > >(1);
|
||||
// messages category
|
||||
new (&_S_messages_char)messages<char>(&_Null_messages);
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
// ctype category
|
||||
new(&_S_ctype_wchar) ctype<wchar_t>(1);
|
||||
// collate category
|
||||
new(&_S_collate_wchar) collate<wchar_t>(1);
|
||||
new(&_S_codecvt_wchar) codecvt<wchar_t, char, mbstate_t>(1);
|
||||
// numeric category
|
||||
new(&_S_numpunct_wchar) numpunct<wchar_t>(1);
|
||||
new (&_S_num_get_wchar) num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >(1);
|
||||
new (&_S_num_put_wchar) num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >(1);
|
||||
new (&_S_time_get_wchar) time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >(1);
|
||||
new (&_S_time_put_wchar) time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >(1);
|
||||
new (&_S_messages_wchar)messages<wchar_t>(&_Null_messages);
|
||||
// monetary category
|
||||
new (&_S_moneypunct_true_wchar) moneypunct<wchar_t, true>(1);
|
||||
new (&_S_moneypunct_false_wchar) moneypunct<wchar_t, false>(1);
|
||||
new (&_S_money_get_wchar) money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >(1);
|
||||
new (&_S_money_put_wchar) money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >(1);
|
||||
# endif
|
||||
|
||||
return classic;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// Declarations of (non-template) facets' static data members
|
||||
size_t locale::id::_S_max = 39;
|
||||
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id collate<char>::id = { 1 };
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id ctype<char>::id = { 2 };
|
||||
|
||||
# ifndef _STLP_NO_MBSTATE_T
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id codecvt<char, char, mbstate_t>::id = { 3 };
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id codecvt<wchar_t, char, mbstate_t>::id = { 22 };
|
||||
# endif
|
||||
# endif
|
||||
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id moneypunct<char, true>::id = { 4 };
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id moneypunct<char, false>::id = { 5 };
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id numpunct<char>::id = { 6 } ;
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id messages<char>::id = { 7 };
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id collate<wchar_t>::id = { 20 };
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id ctype<wchar_t>::id = { 21 };
|
||||
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id moneypunct<wchar_t, true>::id = { 23 } ;
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id moneypunct<wchar_t, false>::id = { 24 } ;
|
||||
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id numpunct<wchar_t>::id = { 25 };
|
||||
_STLP_STATIC_MEMBER_DECLSPEC locale::id messages<wchar_t>::id = { 26 };
|
||||
# endif
|
||||
|
||||
//
|
||||
// locale class
|
||||
//
|
||||
|
||||
locale::facet::~facet() {}
|
||||
|
||||
# if ! defined ( _STLP_MEMBER_TEMPLATES ) || defined (_STLP_INLINE_MEMBER_TEMPLATES)
|
||||
// members that fail to be templates
|
||||
bool locale::operator()(const string& __x,
|
||||
const string& __y) const {
|
||||
return __locale_do_operator_call(this, __x, __y);
|
||||
}
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
bool locale::operator()(const wstring& __x,
|
||||
const wstring& __y) const {
|
||||
return __locale_do_operator_call(this, __x, __y);
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
|
||||
_Locale_impl* _Stl_loc_global_impl = 0;
|
||||
locale _Stl_loc_classic_locale(__REINTERPRET_CAST(_Locale_impl*, &_S_classic_locale));
|
||||
_STLP_STATIC_MUTEX _Stl_loc_global_locale_lock _STLP_MUTEX_INITIALIZER;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// class locale
|
||||
|
||||
void _STLP_CALL
|
||||
locale::_M_throw_runtime_error(const char* name)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
if (name) {
|
||||
const char* prefix = "bad locale name: ";
|
||||
strcpy(buf, prefix);
|
||||
strncat(buf, name, 256 - strlen(prefix));
|
||||
buf[255] = '\0';
|
||||
}
|
||||
else {
|
||||
strcpy(buf, "locale error");
|
||||
}
|
||||
_STLP_THROW(runtime_error(buf));
|
||||
}
|
||||
|
||||
#if !( defined (__BORLANDC__) && defined(_RTLDLL))
|
||||
|
||||
long ios_base::_Loc_init::_S_count = 0;
|
||||
|
||||
ios_base::_Loc_init::_Loc_init() {
|
||||
if (_S_count == 0)
|
||||
locale::_S_initialize();
|
||||
}
|
||||
|
||||
ios_base::_Loc_init::~_Loc_init() {
|
||||
if (_S_count > 0)
|
||||
locale::_S_uninitialize();
|
||||
}
|
||||
|
||||
#endif /* _RTLDLL */
|
||||
|
||||
// Initialization of the locale system. This must be called before
|
||||
// any locales are constructed. (Meaning that it must be called when
|
||||
// the I/O library itself is initialized.)
|
||||
void _STLP_CALL
|
||||
locale::_S_initialize()
|
||||
{
|
||||
// additional check for singleton count : linker may choose to alter the order of function calls on initialization
|
||||
if (ios_base::_Loc_init::_S_count > 0 )
|
||||
return;
|
||||
_Stl_loc_assign_ids();
|
||||
_Stl_loc_global_impl = _Locale_impl::make_classic_locale();
|
||||
++ios_base::_Loc_init::_S_count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _STLP_CALL
|
||||
locale::_S_uninitialize()
|
||||
{
|
||||
// additional check for singleton count : linker may choose to alter the order of function calls on initialization
|
||||
if (ios_base::_Loc_init::_S_count == 0 )
|
||||
return;
|
||||
_Stl_loc_global_impl->decr();
|
||||
--ios_base::_Loc_init::_S_count;
|
||||
}
|
||||
|
||||
|
||||
// Default constructor: create a copy of the global locale.
|
||||
locale::locale() : _M_impl(0) {
|
||||
_M_impl = _S_copy_impl(_Stl_loc_global_impl);
|
||||
}
|
||||
|
||||
locale::locale(_Locale_impl* impl) : _M_impl(impl)
|
||||
{}
|
||||
|
||||
// Copy constructor
|
||||
locale::locale(const locale& L) _STLP_NOTHROW
|
||||
: _M_impl(0)
|
||||
{
|
||||
_M_impl = _S_copy_impl(L._M_impl);
|
||||
}
|
||||
|
||||
// Destructor.
|
||||
locale::~locale() _STLP_NOTHROW
|
||||
{
|
||||
_M_impl->decr();
|
||||
}
|
||||
|
||||
// Assignment operator. Much like the copy constructor: just a bit of
|
||||
// pointer twiddling.
|
||||
const locale& locale::operator=(const locale& L) _STLP_NOTHROW
|
||||
{
|
||||
if (this->_M_impl != L._M_impl) {
|
||||
this->_M_impl->decr();
|
||||
this->_M_impl = _S_copy_impl(L._M_impl);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
locale::facet* locale::_M_get_facet(const locale::id& n) const
|
||||
{
|
||||
return n._M_index < _M_impl->size()
|
||||
? __REINTERPRET_CAST(locale::facet*,_M_impl->facets[n._M_index])
|
||||
: __REINTERPRET_CAST(locale::facet*, 0);
|
||||
}
|
||||
|
||||
locale::facet* locale::_M_use_facet(const locale::id& n) const
|
||||
{
|
||||
locale::facet* f = (n._M_index < _M_impl->size()
|
||||
? __REINTERPRET_CAST(locale::facet*,_M_impl->facets[n._M_index])
|
||||
: __REINTERPRET_CAST(locale::facet*, 0));
|
||||
if (!f)
|
||||
_M_impl->_M_throw_bad_cast();
|
||||
return f;
|
||||
}
|
||||
|
||||
string locale::name() const {
|
||||
return _M_impl->name;
|
||||
}
|
||||
|
||||
static string _Nameless("*");
|
||||
|
||||
// Compare two locales for equality.
|
||||
bool locale::operator==(const locale& L) const {
|
||||
|
||||
return this->_M_impl == L._M_impl ||
|
||||
(this->name() == L.name() && this->name() != _Nameless);
|
||||
}
|
||||
|
||||
bool locale::operator!=(const locale& L) const {
|
||||
return !(*this == L);
|
||||
}
|
||||
|
||||
// Static member functions.
|
||||
const locale& _STLP_CALL
|
||||
locale::classic() {
|
||||
return _Stl_loc_classic_locale;
|
||||
}
|
||||
|
||||
locale _STLP_CALL
|
||||
locale::global(const locale& L)
|
||||
{
|
||||
locale old; // A copy of the old global locale.
|
||||
|
||||
L._M_impl->incr();
|
||||
{
|
||||
_STLP_auto_lock lock(_Stl_loc_global_locale_lock);
|
||||
_Stl_loc_global_impl->decr(); // We made a copy, so it can't be zero.
|
||||
_Stl_loc_global_impl = L._M_impl;
|
||||
}
|
||||
|
||||
// Set the global C locale, if appropriate.
|
||||
#if !defined(_STLP_WINCE)
|
||||
if (L.name() != _Nameless)
|
||||
setlocale(LC_ALL, L.name().c_str());
|
||||
#endif
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
|
||||
// static data members.
|
||||
|
||||
# if !defined (_STLP_STATIC_CONST_INIT_BUG) && ! defined (_STLP_USE_DECLSPEC)
|
||||
|
||||
const locale::category locale::none;
|
||||
const locale::category locale::collate;
|
||||
const locale::category locale::ctype;
|
||||
const locale::category locale::monetary;
|
||||
const locale::category locale::numeric;
|
||||
const locale::category locale::time;
|
||||
const locale::category locale::messages;
|
||||
const locale::category locale::all;
|
||||
|
||||
# endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
//
|
||||
// Facets included in classic locale :
|
||||
//
|
||||
|
||||
|
||||
|
||||
73
STLPORT/src/locale_impl.h
Normal file
73
STLPORT/src/locale_impl.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# ifndef LOCALE_IMPL_H
|
||||
# define LOCALE_IMPL_H
|
||||
|
||||
#include <clocale> // C locale header file.
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <stl/_locale.h>
|
||||
#include "c_locale.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Class _Locale_impl
|
||||
// This is the base class which implements access only and is supposed to
|
||||
// be used for classic locale only
|
||||
class _STLP_CLASS_DECLSPEC _Locale_impl
|
||||
{
|
||||
public:
|
||||
_Locale_impl(const char* s);
|
||||
// _Locale_impl(const _Locale_impl&);
|
||||
virtual ~_Locale_impl();
|
||||
|
||||
virtual void incr();
|
||||
virtual void decr();
|
||||
|
||||
size_t size() const { return _M_size; }
|
||||
|
||||
static _Locale_impl* make_classic_locale();
|
||||
|
||||
locale::facet** facets;
|
||||
size_t _M_size;
|
||||
|
||||
basic_string<char, char_traits<char>, allocator<char> > name;
|
||||
|
||||
static void _STLP_CALL _M_throw_bad_cast();
|
||||
|
||||
private:
|
||||
void operator=(const _Locale_impl&);
|
||||
};
|
||||
|
||||
inline _Locale_impl* _STLP_CALL _S_copy_impl(_Locale_impl* I) {
|
||||
_STLP_ASSERT( I != 0 );
|
||||
I->incr();
|
||||
return I;
|
||||
}
|
||||
|
||||
extern _Locale_impl* _Stl_loc_global_impl;
|
||||
// extern locale* _Stl_loc_classic_locale;
|
||||
extern _STLP_STATIC_MUTEX _Stl_loc_global_locale_lock;
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
59
STLPORT/src/locale_nonclassic.h
Normal file
59
STLPORT/src/locale_nonclassic.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# ifndef LOCALE_nonclassic_H
|
||||
# define LOCALE_nonclassic_H
|
||||
|
||||
# include "locale_impl.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
class _STLP_CLASS_DECLSPEC _Locale : public _Locale_impl, public _Refcount_Base
|
||||
{
|
||||
public:
|
||||
_Locale(size_t n, const char* s) : _Locale_impl(s), _Refcount_Base(1),
|
||||
facets_vec(n, (void*)0 ) { facets = (locale::facet**)&facets_vec[0]; _M_size = n; }
|
||||
_Locale(const _Locale_impl&);
|
||||
~_Locale();
|
||||
|
||||
virtual void incr() { this->_M_incr(); }
|
||||
virtual void decr() { this->_M_decr(); if (!this->_M_ref_count) delete this;}
|
||||
|
||||
void remove(size_t index);
|
||||
locale::facet* insert(locale::facet*, size_t index, bool do_incr);
|
||||
void insert(_Locale_impl* from, const locale::id& n);
|
||||
|
||||
// Helper functions for byname construction of locales.
|
||||
void insert_ctype_facets(const char* name);
|
||||
void insert_numeric_facets(const char* name);
|
||||
void insert_time_facets(const char* name);
|
||||
void insert_collate_facets(const char* name);
|
||||
void insert_monetary_facets(const char* name);
|
||||
void insert_messages_facets(const char* name);
|
||||
|
||||
vector<void*> facets_vec;
|
||||
|
||||
static void _STLP_CALL _M_throw_bad_cast();
|
||||
|
||||
private:
|
||||
void operator=(const _Locale_impl&);
|
||||
};
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
102
STLPORT/src/message_facets.h
Normal file
102
STLPORT/src/message_facets.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
#ifndef MESSAGE_FACETS_H
|
||||
# define MESSAGE_FACETS_H
|
||||
|
||||
#include <string>
|
||||
#include <stl/_messages_facets.h>
|
||||
#include <stl/_ctype.h>
|
||||
// #include <istream>
|
||||
#include <typeinfo>
|
||||
#include <hash_map>
|
||||
#include "c_locale.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
// Forward declaration of an opaque type.
|
||||
struct _Catalog_locale_map;
|
||||
|
||||
_Locale_messages* __acquire_messages(const char* name);
|
||||
void __release_messages(_Locale_messages* cat);
|
||||
|
||||
// Class _Catalog_locale_map. The reason for this is that, internally,
|
||||
// a message string is always a char*. We need a ctype facet to convert
|
||||
// a string to and from wchar_t, and the user is permitted to provide such
|
||||
// a facet when calling open().
|
||||
|
||||
struct _Catalog_locale_map
|
||||
{
|
||||
_Catalog_locale_map() : M(0) {}
|
||||
~_Catalog_locale_map() { if (M) delete M; }
|
||||
|
||||
void insert(int key, const locale& L);
|
||||
locale lookup(int key) const;
|
||||
void erase(int key);
|
||||
|
||||
hash_map<int, locale, hash<int>, equal_to<int> >* M;
|
||||
|
||||
private: // Invalidate copy constructor and assignment
|
||||
_Catalog_locale_map(const _Catalog_locale_map&);
|
||||
void operator=(const _Catalog_locale_map&);
|
||||
};
|
||||
|
||||
|
||||
class _Messages {
|
||||
public:
|
||||
typedef messages_base::catalog catalog;
|
||||
|
||||
_Messages();
|
||||
|
||||
virtual catalog do_open(const string& __fn, const locale& __loc) const;
|
||||
virtual string do_get(catalog __c, int __set, int __msgid,
|
||||
const string& __dfault) const;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
virtual wstring do_get(catalog __c, int __set, int __msgid,
|
||||
const wstring& __dfault) const;
|
||||
# endif
|
||||
virtual void do_close(catalog __c) const;
|
||||
virtual ~_Messages();
|
||||
bool _M_delete;
|
||||
};
|
||||
|
||||
class _Messages_impl : public _Messages {
|
||||
public:
|
||||
|
||||
_Messages_impl(bool);
|
||||
|
||||
_Messages_impl(bool, _Locale_messages*);
|
||||
|
||||
catalog do_open(const string& __fn, const locale& __loc) const;
|
||||
string do_get(catalog __c, int __set, int __msgid,
|
||||
const string& __dfault) const;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wstring do_get(catalog __c, int __set, int __msgid,
|
||||
const wstring& __dfault) const;
|
||||
# endif
|
||||
void do_close(catalog __c) const;
|
||||
|
||||
~_Messages_impl();
|
||||
|
||||
private:
|
||||
_Locale_messages* _M_message_obj;
|
||||
_Catalog_locale_map* _M_map;
|
||||
};
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
111
STLPORT/src/messages.cpp
Normal file
111
STLPORT/src/messages.cpp
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
# include "message_facets.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// messages<char>
|
||||
|
||||
messages<char>::messages(_Messages* imp) :
|
||||
_BaseFacet(1), _M_impl(imp) { imp->_M_delete = false; }
|
||||
|
||||
messages<char>::~messages()
|
||||
{
|
||||
if (_M_impl && _M_impl->_M_delete) delete _M_impl;
|
||||
}
|
||||
|
||||
int messages<char>::do_open(const string& filename, const locale& l) const
|
||||
{
|
||||
return _M_impl->do_open(filename, l);
|
||||
}
|
||||
|
||||
string messages<char>::do_get(catalog cat,
|
||||
int set, int p_id, const string& dfault) const
|
||||
{
|
||||
return _M_impl->do_get(cat, set, p_id, dfault);
|
||||
}
|
||||
|
||||
void messages<char>::do_close(catalog cat) const
|
||||
{
|
||||
_M_impl->do_close(cat);
|
||||
}
|
||||
|
||||
_Messages::_Messages()
|
||||
{ }
|
||||
|
||||
_Messages::~_Messages()
|
||||
{}
|
||||
|
||||
int _Messages::do_open(const string&, const locale&) const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
string _Messages::do_get(catalog,
|
||||
int, int, const string& dfault) const
|
||||
{
|
||||
return dfault;
|
||||
}
|
||||
|
||||
void _Messages::do_close(catalog) const
|
||||
{}
|
||||
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
messages<wchar_t>::messages(_Messages* imp) :
|
||||
_BaseFacet(1), _M_impl(imp) { imp->_M_delete = false; }
|
||||
|
||||
messages<wchar_t>::~messages()
|
||||
{ if (_M_impl && _M_impl->_M_delete) delete _M_impl; }
|
||||
|
||||
int messages<wchar_t>::do_open(const string& filename, const locale& L) const
|
||||
{
|
||||
return _M_impl->do_open(filename, L);
|
||||
}
|
||||
|
||||
wstring
|
||||
messages<wchar_t>::do_get(catalog thecat,
|
||||
int set, int p_id, const wstring& dfault) const
|
||||
{
|
||||
return _M_impl->do_get(thecat, set, p_id, dfault);
|
||||
}
|
||||
|
||||
void messages<wchar_t>::do_close(catalog cat) const
|
||||
{
|
||||
_M_impl->do_close(cat);
|
||||
}
|
||||
|
||||
wstring
|
||||
_Messages::do_get(catalog,
|
||||
int, int, const wstring& dfault) const
|
||||
{
|
||||
return dfault;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
32
STLPORT/src/mkinstalldirs
Normal file
32
STLPORT/src/mkinstalldirs
Normal file
@@ -0,0 +1,32 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Last modified: 1994-03-25
|
||||
# Public domain
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file in ${1+"$@"} ; do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d in ${1+"$@"} ; do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
mkdir "$pathcomp" || errstatus=$?
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
||||
149
STLPORT/src/monetary.cpp
Normal file
149
STLPORT/src/monetary.cpp
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
#include <stl/_monetary.h>
|
||||
#include <stl/_istream.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
static void _Init_monetary_formats(money_base::pattern& pos_format,
|
||||
money_base::pattern& neg_format) {
|
||||
pos_format.field[0] = (char) money_base::symbol;
|
||||
pos_format.field[1] = (char) money_base::sign;
|
||||
pos_format.field[2] = (char) money_base::none;
|
||||
pos_format.field[3] = (char) money_base::value;
|
||||
|
||||
neg_format.field[0] = (char) money_base::symbol;
|
||||
neg_format.field[1] = (char) money_base::sign;
|
||||
neg_format.field[2] = (char) money_base::none;
|
||||
neg_format.field[3] = (char) money_base::value;
|
||||
}
|
||||
|
||||
// This is being used throughout the library
|
||||
string _S_empty_string("");
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
wstring _S_empty_wstring(L"");
|
||||
# endif
|
||||
|
||||
//
|
||||
// moneypunct<>
|
||||
//
|
||||
|
||||
moneypunct<char, true>::moneypunct(size_t __refs) : _BaseFacet(__refs) {
|
||||
_Init_monetary_formats(_M_pos_format, _M_neg_format);
|
||||
}
|
||||
moneypunct<char, true>::~moneypunct() {}
|
||||
|
||||
char moneypunct<char, true>::do_decimal_point() const {return ' ';}
|
||||
char moneypunct<char, true>::do_thousands_sep() const {return ' ';}
|
||||
string moneypunct<char, true>::do_grouping() const { return _S_empty_string; }
|
||||
string moneypunct<char, true>::do_curr_symbol() const { return _S_empty_string; }
|
||||
string moneypunct<char, true>::do_positive_sign() const { return _S_empty_string; }
|
||||
string moneypunct<char, true>::do_negative_sign() const { return _S_empty_string; }
|
||||
money_base::pattern moneypunct<char, true>::do_pos_format() const {return _M_pos_format;}
|
||||
money_base::pattern moneypunct<char, true>::do_neg_format() const {return _M_neg_format;}
|
||||
int moneypunct<char, true>::do_frac_digits() const {return 0;}
|
||||
|
||||
moneypunct<char, false>::moneypunct(size_t __refs) : _BaseFacet(__refs) {
|
||||
_Init_monetary_formats(_M_pos_format, _M_neg_format);
|
||||
}
|
||||
moneypunct<char, false>::~moneypunct() {}
|
||||
|
||||
char moneypunct<char, false>::do_decimal_point() const {return ' ';}
|
||||
char moneypunct<char, false>::do_thousands_sep() const {return ' ';}
|
||||
|
||||
string moneypunct<char, false>::do_grouping() const { return _S_empty_string; }
|
||||
string moneypunct<char, false>::do_curr_symbol() const { return _S_empty_string; }
|
||||
string moneypunct<char, false>::do_positive_sign() const { return _S_empty_string; }
|
||||
string moneypunct<char, false>::do_negative_sign() const { return _S_empty_string; }
|
||||
money_base::pattern moneypunct<char, false>::do_pos_format() const {return _M_pos_format;}
|
||||
money_base::pattern moneypunct<char, false>::do_neg_format() const {return _M_neg_format;}
|
||||
int moneypunct<char, false>::do_frac_digits() const {return 0;}
|
||||
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
moneypunct<wchar_t, true>::moneypunct(size_t __refs) : _BaseFacet(__refs) {
|
||||
_Init_monetary_formats(_M_pos_format, _M_neg_format);
|
||||
}
|
||||
moneypunct<wchar_t, true>::~moneypunct() {}
|
||||
|
||||
wchar_t moneypunct<wchar_t, true>::do_decimal_point() const {return L' ';}
|
||||
wchar_t moneypunct<wchar_t, true>::do_thousands_sep() const {return L' ';}
|
||||
string moneypunct<wchar_t, true>::do_grouping() const {return _S_empty_string;}
|
||||
|
||||
wstring moneypunct<wchar_t, true>::do_curr_symbol() const
|
||||
{return _S_empty_wstring;}
|
||||
wstring moneypunct<wchar_t, true>::do_positive_sign() const
|
||||
{return _S_empty_wstring;}
|
||||
wstring moneypunct<wchar_t, true>::do_negative_sign() const
|
||||
{return _S_empty_wstring;}
|
||||
int moneypunct<wchar_t, true>::do_frac_digits() const {return 0;}
|
||||
money_base::pattern moneypunct<wchar_t, true>::do_pos_format() const
|
||||
{return _M_pos_format;}
|
||||
money_base::pattern moneypunct<wchar_t, true>::do_neg_format() const
|
||||
{return _M_neg_format;}
|
||||
|
||||
moneypunct<wchar_t, false>::moneypunct(size_t __refs) : _BaseFacet(__refs) {
|
||||
_Init_monetary_formats(_M_pos_format, _M_neg_format);
|
||||
}
|
||||
moneypunct<wchar_t, false>::~moneypunct() {}
|
||||
|
||||
wchar_t moneypunct<wchar_t, false>::do_decimal_point() const {return L' ';}
|
||||
wchar_t moneypunct<wchar_t, false>::do_thousands_sep() const {return L' ';}
|
||||
string moneypunct<wchar_t, false>::do_grouping() const { return _S_empty_string;}
|
||||
wstring moneypunct<wchar_t, false>::do_curr_symbol() const
|
||||
{return _S_empty_wstring;}
|
||||
wstring moneypunct<wchar_t, false>::do_positive_sign() const
|
||||
{return _S_empty_wstring;}
|
||||
wstring moneypunct<wchar_t, false>::do_negative_sign() const
|
||||
{return _S_empty_wstring;}
|
||||
int moneypunct<wchar_t, false>::do_frac_digits() const {return 0;}
|
||||
|
||||
money_base::pattern moneypunct<wchar_t, false>::do_pos_format() const
|
||||
{return _M_pos_format;}
|
||||
money_base::pattern moneypunct<wchar_t, false>::do_neg_format() const
|
||||
{return _M_neg_format;}
|
||||
|
||||
# endif /* WCHAR_T */
|
||||
|
||||
//
|
||||
// Instantiations
|
||||
//
|
||||
|
||||
# if !defined(_STLP_NO_FORCE_INSTANTIATE)
|
||||
|
||||
template class money_get<char, istreambuf_iterator<char, char_traits<char> > >;
|
||||
template class money_put<char, ostreambuf_iterator<char, char_traits<char> > >;
|
||||
// template class money_put<char, char*>;
|
||||
|
||||
#ifndef _STLP_NO_WCHAR_T
|
||||
template class money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
||||
template class money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
||||
// template class money_put<wchar_t, wchar_t*>;
|
||||
// template class money_get<wchar_t, const wchar_t*>;
|
||||
#endif
|
||||
|
||||
# endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
11
STLPORT/src/msvc_warning_disablers.h
Normal file
11
STLPORT/src/msvc_warning_disablers.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma warning( disable : 4146 ) // unary minus applied to unsigned type
|
||||
#pragma warning( disable : 4244 ) // arithmetic conversion - possible loss of data
|
||||
#pragma warning( disable : 4290 ) // c++ exception specification ignored
|
||||
|
||||
// dwa 1/28/00 - actually I think this may indicate real bugs. We should look
|
||||
// into these
|
||||
#pragma warning( disable : 4018 ) // signed/unsigned mismatch
|
||||
#pragma warning( disable : 4251 ) // DLL interface needed
|
||||
|
||||
|
||||
|
||||
3
STLPORT/src/mwerks_debug_prefix.h
Normal file
3
STLPORT/src/mwerks_debug_prefix.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#define __BUILDING_STLPORT 1
|
||||
#define _STLP_OWN_IOSTREAMS 1
|
||||
#define _STLP_DEBUG 1
|
||||
2
STLPORT/src/mwerks_prefix.h
Normal file
2
STLPORT/src/mwerks_prefix.h
Normal file
@@ -0,0 +1,2 @@
|
||||
#define __BUILDING_STLPORT 1
|
||||
#define _STLP_OWN_IOSTREAMS 1
|
||||
BIN
STLPORT/src/mwerks_prj/libstlport_Data/CWSettingsWindows.stg
Normal file
BIN
STLPORT/src/mwerks_prj/libstlport_Data/CWSettingsWindows.stg
Normal file
Binary file not shown.
4
STLPORT/src/mwerks_x86_prefix.h
Normal file
4
STLPORT/src/mwerks_x86_prefix.h
Normal file
@@ -0,0 +1,4 @@
|
||||
// #define __BUILDING_STLPORT 1
|
||||
#define _STLP_OWN_IOSTREAMS 1
|
||||
// #define _DLL
|
||||
#define _WIN32
|
||||
157
STLPORT/src/nmake_common.mak
Normal file
157
STLPORT/src/nmake_common.mak
Normal file
@@ -0,0 +1,157 @@
|
||||
|
||||
install_dlls:
|
||||
@echo Copying STLport DLLs to Windows system directory...
|
||||
@if "%OS%" == "Windows_NT" copy $(OUTDIR)\$(LIB_BASENAME)*.dll $(WINDIR)\System32
|
||||
@if "%OS%" == "" copy $(OUTDIR)\$(LIB_BASENAME)*.dll $(WINDIR)\System
|
||||
@echo STLport DLL libraries are installed on your system.
|
||||
|
||||
install_libs_vc:
|
||||
@echo Copying STLport .lib files to VC lib directory : %MSVCDir%\lib...
|
||||
@copy $(OUTDIR)\$(LIB_BASENAME)*.lib "%MSVCDir%\lib"
|
||||
@echo Done copying .lib files.
|
||||
|
||||
install_headers_vc:
|
||||
@echo Copying STLport headers files to VC include directory : %MSVCDir%\include\stlport...
|
||||
@xcopy /Q /R /K /I /S ..\stlport "%MSVCDir%\include\stlport\"
|
||||
@echo Done copying STLport headers.
|
||||
|
||||
check_env_vc:
|
||||
@if not exist "%MSVCDir%\lib\*.*" echo "Please set up MSVCDir environment variable. Did you run vcvars32.bat ?"
|
||||
@if not exist "%MSVCDir%\lib\*.*" dir "%MSVCDir%\lib"
|
||||
|
||||
install_vc : all check_env_vc install_libs_vc install_dlls install_headers_vc report_dirs_vc
|
||||
|
||||
install_bc : all install_dlls
|
||||
|
||||
report_dirs_vc :
|
||||
@echo STLport installation complete.
|
||||
@echo Please find STLport headers in %MSVCDir%\include\stlport.
|
||||
@echo Please find STLport .lib files in %MSVCDir%\lib.
|
||||
@echo Please find STLport DLLs in Windows system directory.
|
||||
|
||||
{$(SRCDIR)}.cpp{$(RELEASE_OBJDIR_static)}.obj:
|
||||
$(CXX) $(CXXFLAGS_RELEASE_static) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(RELEASE_OBJDIR_static)}.obj:
|
||||
$(CC) $(CXXFLAGS_RELEASE_static) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(RELEASE_OBJDIR_static)}.sbr:
|
||||
$(CC) $(CXXFLAGS_RELEASE_static) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(RELEASE_OBJDIR_static)}.sbr:
|
||||
$(CXX) $(CXXFLAGS_RELEASE_static) $<
|
||||
|
||||
|
||||
{$(SRCDIR)}.cpp{$(RELEASE_OBJDIR_staticx)}.obj:
|
||||
$(CXX) $(CXXFLAGS_RELEASE_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(RELEASE_OBJDIR_staticx)}.obj:
|
||||
$(CC) $(CXXFLAGS_RELEASE_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(RELEASE_OBJDIR_staticx)}.sbr:
|
||||
$(CC) $(CXXFLAGS_RELEASE_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(RELEASE_OBJDIR_staticx)}.sbr:
|
||||
$(CXX) $(CXXFLAGS_RELEASE_staticx) $<
|
||||
|
||||
|
||||
{$(SRCDIR)}.cpp{$(RELEASE_OBJDIR_dynamic)}.obj:
|
||||
$(CXX) $(CXXFLAGS_RELEASE_dynamic) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(RELEASE_OBJDIR_dynamic)}.obj:
|
||||
$(CC) $(CXXFLAGS_RELEASE_dynamic) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(RELEASE_OBJDIR_dynamic)}.sbr:
|
||||
$(CC) $(CXXFLAGS_RELEASE_dynamic) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(RELEASE_OBJDIR_dynamic)}.sbr:
|
||||
$(CXX) $(CXXFLAGS_RELEASE_dynamic) $<
|
||||
|
||||
#########################################
|
||||
|
||||
{$(SRCDIR)}.cpp{$(DEBUG_OBJDIR_static)}.obj:
|
||||
$(CXX) $(CXXFLAGS_DEBUG_static) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(DEBUG_OBJDIR_static)}.obj:
|
||||
$(CC) $(CXXFLAGS_DEBUG_static) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(DEBUG_OBJDIR_static)}.sbr:
|
||||
$(CC) $(CXXFLAGS_DEBUG_static) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(DEBUG_OBJDIR_static)}.sbr:
|
||||
$(CXX) $(CXXFLAGS_DEBUG_static) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(DEBUG_OBJDIR_staticx)}.obj:
|
||||
$(CXX) $(CXXFLAGS_DEBUG_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(DEBUG_OBJDIR_staticx)}.obj:
|
||||
$(CC) $(CXXFLAGS_DEBUG_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(DEBUG_OBJDIR_staticx)}.sbr:
|
||||
$(CC) $(CXXFLAGS_DEBUG_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(DEBUG_OBJDIR_staticx)}.sbr:
|
||||
$(CXX) $(CXXFLAGS_DEBUG_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(DEBUG_OBJDIR_dynamic)}.obj:
|
||||
$(CXX) $(CXXFLAGS_DEBUG_dynamic) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(DEBUG_OBJDIR_dynamic)}.obj:
|
||||
$(CC) $(CXXFLAGS_DEBUG_dynamic) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(DEBUG_OBJDIR_dynamic)}.sbr:
|
||||
$(CC) $(CXXFLAGS_DEBUG_dynamic) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(DEBUG_OBJDIR_dynamic)}.sbr:
|
||||
$(CXX) $(CXXFLAGS_DEBUG_dynamic) $<
|
||||
|
||||
#########################################
|
||||
|
||||
{$(SRCDIR)}.cpp{$(STLDEBUG_OBJDIR_static)}.obj:
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_static) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(STLDEBUG_OBJDIR_static)}.obj:
|
||||
$(CC) $(CXXFLAGS_STLDEBUG_static) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(STLDEBUG_OBJDIR_static)}.sbr:
|
||||
$(CC) $(CXXFLAGS_STLDEBUG_static) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(STLDEBUG_OBJDIR_static)}.sbr:
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_static) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(STLDEBUG_OBJDIR_staticx)}.obj:
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(STLDEBUG_OBJDIR_staticx)}.obj:
|
||||
$(CC) $(CXXFLAGS_STLDEBUG_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(STLDEBUG_OBJDIR_staticx)}.sbr:
|
||||
$(CC) $(CXXFLAGS_STLDEBUG_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(STLDEBUG_OBJDIR_staticx)}.sbr:
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_staticx) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(STLDEBUG_OBJDIR_dynamic)}.obj:
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_dynamic) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(STLDEBUG_OBJDIR_dynamic)}.obj:
|
||||
$(CC) $(CXXFLAGS_STLDEBUG_dynamic) $<
|
||||
|
||||
{$(SRCDIR)}.c{$(STLDEBUG_OBJDIR_dynamic)}.sbr:
|
||||
$(CC) $(CXXFLAGS_STLDEBUG_dynamic) $<
|
||||
|
||||
{$(SRCDIR)}.cpp{$(STLDEBUG_OBJDIR_dynamic)}.sbr:
|
||||
$(CXX) $(CXXFLAGS_STLDEBUG_dynamic) $<
|
||||
|
||||
############################################
|
||||
|
||||
{$(SRCDIR)}.rc{$(RELEASE_OBJDIR_dynamic)}.res:
|
||||
$(RC) /d COMP=$(COMP) /fo $(RELEASE_OBJDIR_dynamic)\stlport.res $<
|
||||
|
||||
{$(SRCDIR)}.rc{$(DEBUG_OBJDIR_dynamic)}.res:
|
||||
$(RC) /d COMP=$(COMP) /d BUILD=_DEBUG /fo $(DEBUG_OBJDIR_dynamic)\stlport.res $<
|
||||
|
||||
{$(SRCDIR)}.rc{$(STLDEBUG_OBJDIR_dynamic)}.res:
|
||||
$(RC) /d COMP=$(COMP) /d BUILD=_STLDEBUG /fo $(STLDEBUG_OBJDIR_dynamic)\stlport.res $<
|
||||
|
||||
|
||||
173
STLPORT/src/num_get.cpp
Normal file
173
STLPORT/src/num_get.cpp
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
#include <stl/_num_get.h>
|
||||
#include <stl/_istream.h>
|
||||
#include <stl/_algo.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// num_get
|
||||
|
||||
|
||||
static char narrow_digits[11] = "0123456789";
|
||||
static char narrow_xdigits[13] = "aAbBcCdDeEfF";
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
void _STLP_CALL
|
||||
_Initialize_get_digit(wchar_t* digits, wchar_t* xdigits,
|
||||
const ctype<wchar_t>& ct)
|
||||
{
|
||||
ct.widen(narrow_digits + 0, narrow_digits + 10, digits);
|
||||
ct.widen(narrow_xdigits + 0, narrow_xdigits + 10, xdigits);
|
||||
}
|
||||
|
||||
// Return either the digit corresponding to c, or a negative number if
|
||||
// if c isn't a digit. We return -1 if c is the separator character, and
|
||||
// -2 if it's some other non-digit.
|
||||
int _STLP_CALL __get_digit(wchar_t c,
|
||||
const wchar_t* digits, const wchar_t* xdigits,
|
||||
wchar_t separator)
|
||||
{
|
||||
// Test if it's the separator.
|
||||
if (c == separator)
|
||||
return -1;
|
||||
|
||||
const wchar_t* p;
|
||||
|
||||
// Test if it's a decimal digit.
|
||||
p = find(digits, digits + 10, c);
|
||||
if (p != digits + 10)
|
||||
return (int)(p - digits);
|
||||
|
||||
// Test if it's a hex digit.
|
||||
p = find(xdigits, xdigits + 12, c);
|
||||
if (p != xdigits + 12)
|
||||
return (int)(10 + (xdigits - p) / 2);
|
||||
else
|
||||
return -2; // It's not a digit and not the separator.
|
||||
}
|
||||
|
||||
# endif /* _STLP_NO_WCHAR_T */
|
||||
|
||||
// __valid_grouping compares two strings, one representing the
|
||||
// group sizes encountered when reading an integer, and the other
|
||||
// representing the valid group sizes as returned by the numpunct
|
||||
// grouping() member function. Both are interpreted right-to-left.
|
||||
// The grouping string is treated as if it were extended indefinitely
|
||||
// with its last value. For a grouping to be valid, each term in
|
||||
// the first string must be equal to the corresponding term in the
|
||||
// second, except for the last, which must be less than or equal.
|
||||
|
||||
// boris : this takes reversed first string !
|
||||
bool _STLP_CALL
|
||||
__valid_grouping(const char * first1, const char * last1,
|
||||
const char * first2, const char * last2)
|
||||
{
|
||||
if (first1 == last1 || first2 == last2) return true;
|
||||
|
||||
--last1; --last2;
|
||||
|
||||
while (first1 != last1) {
|
||||
if (*last1 != *first2)
|
||||
return false;
|
||||
--last1;
|
||||
if (first2 != last2) ++first2;
|
||||
}
|
||||
|
||||
return *last1 <= *first2;
|
||||
}
|
||||
|
||||
// this needed for some compilers to make sure sumbols are extern
|
||||
extern const unsigned char __digit_val_table[];
|
||||
extern const char __narrow_atoms[];
|
||||
|
||||
|
||||
const unsigned char __digit_val_table[128] =
|
||||
{
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
0xFF,10,11,12,13,14,15,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
0xFF,10,11,12,13,14,15,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
|
||||
};
|
||||
|
||||
const char __narrow_atoms[5] = {'+', '-', '0', 'x', 'X'};
|
||||
|
||||
// index is actually a char
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
// Similar, except return the character itself instead of the numeric
|
||||
// value. Used for floating-point input.
|
||||
bool _STLP_CALL __get_fdigit(wchar_t& c, const wchar_t* digits)
|
||||
{
|
||||
const wchar_t* p = find(digits, digits + 10, c);
|
||||
if (p != digits + 10) {
|
||||
c = (char)('0' + (p - digits));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool _STLP_CALL __get_fdigit_or_sep(wchar_t& c, wchar_t sep,
|
||||
const wchar_t * digits)
|
||||
{
|
||||
if (c == sep) {
|
||||
c = (char)',';
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return __get_fdigit(c, digits);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Force instantiation of of num_get<>
|
||||
|
||||
#if !defined(_STLP_NO_FORCE_INSTANTIATE)
|
||||
template class _STLP_CLASS_DECLSPEC istreambuf_iterator<wchar_t, char_traits<wchar_t> >;
|
||||
template class num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
||||
// template class num_get<wchar_t, const wchar_t*>;
|
||||
#endif
|
||||
|
||||
# endif /* _STLP_NO_WCHAR_T */
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Force instantiation of of num_get<>
|
||||
|
||||
#if !defined(_STLP_NO_FORCE_INSTANTIATE)
|
||||
template class _STLP_CLASS_DECLSPEC istreambuf_iterator<char, char_traits<char> >;
|
||||
// template class num_get<char, const char*>;
|
||||
template class num_get<char, istreambuf_iterator<char, char_traits<char> > >;
|
||||
#endif
|
||||
|
||||
// basic_streambuf<char, char_traits<char> >* _STLP_CALL _M_get_istreambuf(basic_istream<char, char_traits<char> >& ) ;
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
|
||||
792
STLPORT/src/num_get_float.cpp
Normal file
792
STLPORT/src/num_get_float.cpp
Normal file
@@ -0,0 +1,792 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
#include <stl/_limits.h>
|
||||
#include <stl/_num_get.h>
|
||||
#include <stl/_istream.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// num_get
|
||||
|
||||
// Helper functions for _M_do_get_float.
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
void _STLP_CALL
|
||||
_Initialize_get_float( const ctype<wchar_t>& ct,
|
||||
wchar_t& Plus, wchar_t& Minus,
|
||||
wchar_t& pow_e, wchar_t& pow_E,
|
||||
wchar_t* digits)
|
||||
{
|
||||
char ndigits[11] = "0123456789";
|
||||
Plus = ct.widen('+');
|
||||
Minus = ct.widen('-');
|
||||
pow_e = ct.widen('e');
|
||||
pow_E = ct.widen('E');
|
||||
ct.widen(ndigits + 0, ndigits + 10, digits);
|
||||
}
|
||||
|
||||
# endif /* WCHAR_T */
|
||||
|
||||
/*
|
||||
* __string_to_double is just lifted from atof, the difference being
|
||||
* that we just use '.' for the decimal point, rather than let it
|
||||
* be taken from the current C locale, which of course is not accessible
|
||||
* to us.
|
||||
*/
|
||||
|
||||
typedef unsigned int uint32;
|
||||
# if defined (_STLP_MSVC) || defined (__BORLANDC__) || defined (__ICL)
|
||||
# define ULL(x) x##Ui64
|
||||
typedef unsigned _STLP_LONG_LONG uint64;
|
||||
# elif defined (_STLP_LONG_LONG)
|
||||
typedef unsigned _STLP_LONG_LONG uint64;
|
||||
# define ULL(x) x##ULL
|
||||
# elif defined(__MRC__) || defined(__SC__) //*TY 02/25/2000 - added support for MPW compilers
|
||||
# include "uint64.h" //*TY 03/25/2000 - added 64bit math type definition
|
||||
# else
|
||||
# error "there should be some long long type on the system!"
|
||||
# define NUMERIC_NO_64 1
|
||||
# endif
|
||||
|
||||
// Multiplication of two 64-bit integers, giving a 128-bit result.
|
||||
// Taken from Algorithm M in Knuth section 4.3.1, with the loop
|
||||
// hand-unrolled.
|
||||
void _Stl_mult64(const uint64 u, const uint64 v,
|
||||
uint64& high, uint64& low)
|
||||
{
|
||||
const uint64 low_mask = ULL(0xffffffff);
|
||||
const uint64 u0 = u & low_mask;
|
||||
const uint64 u1 = u >> 32;
|
||||
const uint64 v0 = v & low_mask;
|
||||
const uint64 v1 = v >> 32;
|
||||
|
||||
uint64 t = u0 * v0;
|
||||
low = t & low_mask;
|
||||
|
||||
t = u1 * v0 + (t >> 32);
|
||||
uint64 w1 = t & low_mask;
|
||||
uint64 w2 = t >> 32;
|
||||
|
||||
uint64 x = u0 * v1 + w1;
|
||||
low += (x & low_mask) << 32;
|
||||
high = u1 * v1 + w2 + (x >> 32);
|
||||
}
|
||||
|
||||
# define bit11 ULL(0x7ff)
|
||||
# define exponent_mask (bit11 << 52)
|
||||
|
||||
inline void _Stl_set_exponent(uint64& val, uint64 exp)
|
||||
{
|
||||
val = (val & ~exponent_mask) | ((exp & bit11) << 52);
|
||||
}
|
||||
|
||||
/* Power of ten fractions for tenscale*/
|
||||
/* The constants are factored so that at most two constants
|
||||
* and two multiplies are needed. Furthermore, one of the constants
|
||||
* is represented exactly - 10**n where 1<= n <= 27.
|
||||
*/
|
||||
|
||||
#if !defined(__SC__) //*TY 03/25/2000 - no native 64bit integer under SCpp
|
||||
static const uint64 _Stl_tenpow[80] = {
|
||||
ULL(0xa000000000000000), /* _Stl_tenpow[0]=(10**1)/(2**4) */
|
||||
ULL(0xc800000000000000), /* _Stl_tenpow[1]=(10**2)/(2**7) */
|
||||
ULL(0xfa00000000000000), /* _Stl_tenpow[2]=(10**3)/(2**10) */
|
||||
ULL(0x9c40000000000000), /* _Stl_tenpow[3]=(10**4)/(2**14) */
|
||||
ULL(0xc350000000000000), /* _Stl_tenpow[4]=(10**5)/(2**17) */
|
||||
ULL(0xf424000000000000), /* _Stl_tenpow[5]=(10**6)/(2**20) */
|
||||
ULL(0x9896800000000000), /* _Stl_tenpow[6]=(10**7)/(2**24) */
|
||||
ULL(0xbebc200000000000), /* _Stl_tenpow[7]=(10**8)/(2**27) */
|
||||
ULL(0xee6b280000000000), /* _Stl_tenpow[8]=(10**9)/(2**30) */
|
||||
ULL(0x9502f90000000000), /* _Stl_tenpow[9]=(10**10)/(2**34) */
|
||||
ULL(0xba43b74000000000), /* _Stl_tenpow[10]=(10**11)/(2**37) */
|
||||
ULL(0xe8d4a51000000000), /* _Stl_tenpow[11]=(10**12)/(2**40) */
|
||||
ULL(0x9184e72a00000000), /* _Stl_tenpow[12]=(10**13)/(2**44) */
|
||||
ULL(0xb5e620f480000000), /* _Stl_tenpow[13]=(10**14)/(2**47) */
|
||||
ULL(0xe35fa931a0000000), /* _Stl_tenpow[14]=(10**15)/(2**50) */
|
||||
ULL(0x8e1bc9bf04000000), /* _Stl_tenpow[15]=(10**16)/(2**54) */
|
||||
ULL(0xb1a2bc2ec5000000), /* _Stl_tenpow[16]=(10**17)/(2**57) */
|
||||
ULL(0xde0b6b3a76400000), /* _Stl_tenpow[17]=(10**18)/(2**60) */
|
||||
ULL(0x8ac7230489e80000), /* _Stl_tenpow[18]=(10**19)/(2**64) */
|
||||
ULL(0xad78ebc5ac620000), /* _Stl_tenpow[19]=(10**20)/(2**67) */
|
||||
ULL(0xd8d726b7177a8000), /* _Stl_tenpow[20]=(10**21)/(2**70) */
|
||||
ULL(0x878678326eac9000), /* _Stl_tenpow[21]=(10**22)/(2**74) */
|
||||
ULL(0xa968163f0a57b400), /* _Stl_tenpow[22]=(10**23)/(2**77) */
|
||||
ULL(0xd3c21bcecceda100), /* _Stl_tenpow[23]=(10**24)/(2**80) */
|
||||
ULL(0x84595161401484a0), /* _Stl_tenpow[24]=(10**25)/(2**84) */
|
||||
ULL(0xa56fa5b99019a5c8), /* _Stl_tenpow[25]=(10**26)/(2**87) */
|
||||
ULL(0xcecb8f27f4200f3a), /* _Stl_tenpow[26]=(10**27)/(2**90) */
|
||||
|
||||
ULL(0xd0cf4b50cfe20766), /* _Stl_tenpow[27]=(10**55)/(2**183) */
|
||||
ULL(0xd2d80db02aabd62c), /* _Stl_tenpow[28]=(10**83)/(2**276) */
|
||||
ULL(0xd4e5e2cdc1d1ea96), /* _Stl_tenpow[29]=(10**111)/(2**369) */
|
||||
ULL(0xd6f8d7509292d603), /* _Stl_tenpow[30]=(10**139)/(2**462) */
|
||||
ULL(0xd910f7ff28069da4), /* _Stl_tenpow[31]=(10**167)/(2**555) */
|
||||
ULL(0xdb2e51bfe9d0696a), /* _Stl_tenpow[32]=(10**195)/(2**648) */
|
||||
ULL(0xdd50f1996b947519), /* _Stl_tenpow[33]=(10**223)/(2**741) */
|
||||
ULL(0xdf78e4b2bd342cf7), /* _Stl_tenpow[34]=(10**251)/(2**834) */
|
||||
ULL(0xe1a63853bbd26451), /* _Stl_tenpow[35]=(10**279)/(2**927) */
|
||||
ULL(0xe3d8f9e563a198e5), /* _Stl_tenpow[36]=(10**307)/(2**1020) */
|
||||
|
||||
ULL(0xfd87b5f28300ca0e), /* _Stl_tenpow[37]=(10**-28)/(2**-93) */
|
||||
ULL(0xfb158592be068d2f), /* _Stl_tenpow[38]=(10**-56)/(2**-186) */
|
||||
ULL(0xf8a95fcf88747d94), /* _Stl_tenpow[39]=(10**-84)/(2**-279) */
|
||||
ULL(0xf64335bcf065d37d), /* _Stl_tenpow[40]=(10**-112)/(2**-372) */
|
||||
ULL(0xf3e2f893dec3f126), /* _Stl_tenpow[41]=(10**-140)/(2**-465) */
|
||||
ULL(0xf18899b1bc3f8ca2), /* _Stl_tenpow[42]=(10**-168)/(2**-558) */
|
||||
ULL(0xef340a98172aace5), /* _Stl_tenpow[43]=(10**-196)/(2**-651) */
|
||||
ULL(0xece53cec4a314ebe), /* _Stl_tenpow[44]=(10**-224)/(2**-744) */
|
||||
ULL(0xea9c227723ee8bcb), /* _Stl_tenpow[45]=(10**-252)/(2**-837) */
|
||||
ULL(0xe858ad248f5c22ca), /* _Stl_tenpow[46]=(10**-280)/(2**-930) */
|
||||
ULL(0xe61acf033d1a45df), /* _Stl_tenpow[47]=(10**-308)/(2**-1023) */
|
||||
ULL(0xe3e27a444d8d98b8), /* _Stl_tenpow[48]=(10**-336)/(2**-1116) */
|
||||
ULL(0xe1afa13afbd14d6e) /* _Stl_tenpow[49]=(10**-364)/(2**-1209) */
|
||||
|
||||
#else //*TY 03/20/2000 - added support for SCpp which lacks native 64bit integer type
|
||||
static const UnsignedWide _Stl_tenpow[80] = {
|
||||
ULL2(0xa0000000,0x00000000), /* _Stl_tenpow[0]=(10**1)/(2**4) */
|
||||
ULL2(0xc8000000,0x00000000), /* _Stl_tenpow[1]=(10**2)/(2**7) */
|
||||
ULL2(0xfa000000,0x00000000), /* _Stl_tenpow[2]=(10**3)/(2**10) */
|
||||
ULL2(0x9c400000,0x00000000), /* _Stl_tenpow[3]=(10**4)/(2**14) */
|
||||
ULL2(0xc3500000,0x00000000), /* _Stl_tenpow[4]=(10**5)/(2**17) */
|
||||
ULL2(0xf4240000,0x00000000), /* _Stl_tenpow[5]=(10**6)/(2**20) */
|
||||
ULL2(0x98968000,0x00000000), /* _Stl_tenpow[6]=(10**7)/(2**24) */
|
||||
ULL2(0xbebc2000,0x00000000), /* _Stl_tenpow[7]=(10**8)/(2**27) */
|
||||
ULL2(0xee6b2800,0x00000000), /* _Stl_tenpow[8]=(10**9)/(2**30) */
|
||||
ULL2(0x9502f900,0x00000000), /* _Stl_tenpow[9]=(10**10)/(2**34) */
|
||||
ULL2(0xba43b740,0x00000000), /* _Stl_tenpow[10]=(10**11)/(2**37) */
|
||||
ULL2(0xe8d4a510,0x00000000), /* _Stl_tenpow[11]=(10**12)/(2**40) */
|
||||
ULL2(0x9184e72a,0x00000000), /* _Stl_tenpow[12]=(10**13)/(2**44) */
|
||||
ULL2(0xb5e620f4,0x80000000), /* _Stl_tenpow[13]=(10**14)/(2**47) */
|
||||
ULL2(0xe35fa931,0xa0000000), /* _Stl_tenpow[14]=(10**15)/(2**50) */
|
||||
ULL2(0x8e1bc9bf,0x04000000), /* _Stl_tenpow[15]=(10**16)/(2**54) */
|
||||
ULL2(0xb1a2bc2e,0xc5000000), /* _Stl_tenpow[16]=(10**17)/(2**57) */
|
||||
ULL2(0xde0b6b3a,0x76400000), /* _Stl_tenpow[17]=(10**18)/(2**60) */
|
||||
ULL2(0x8ac72304,0x89e80000), /* _Stl_tenpow[18]=(10**19)/(2**64) */
|
||||
ULL2(0xad78ebc5,0xac620000), /* _Stl_tenpow[19]=(10**20)/(2**67) */
|
||||
ULL2(0xd8d726b7,0x177a8000), /* _Stl_tenpow[20]=(10**21)/(2**70) */
|
||||
ULL2(0x87867832,0x6eac9000), /* _Stl_tenpow[21]=(10**22)/(2**74) */
|
||||
ULL2(0xa968163f,0x0a57b400), /* _Stl_tenpow[22]=(10**23)/(2**77) */
|
||||
ULL2(0xd3c21bce,0xcceda100), /* _Stl_tenpow[23]=(10**24)/(2**80) */
|
||||
ULL2(0x84595161,0x401484a0), /* _Stl_tenpow[24]=(10**25)/(2**84) */
|
||||
ULL2(0xa56fa5b9,0x9019a5c8), /* _Stl_tenpow[25]=(10**26)/(2**87) */
|
||||
ULL2(0xcecb8f27,0xf4200f3a), /* _Stl_tenpow[26]=(10**27)/(2**90) */
|
||||
|
||||
ULL2(0xd0cf4b50,0xcfe20766), /* _Stl_tenpow[27]=(10**55)/(2**183) */
|
||||
ULL2(0xd2d80db0,0x2aabd62c), /* _Stl_tenpow[28]=(10**83)/(2**276) */
|
||||
ULL2(0xd4e5e2cd,0xc1d1ea96), /* _Stl_tenpow[29]=(10**111)/(2**369) */
|
||||
ULL2(0xd6f8d750,0x9292d603), /* _Stl_tenpow[30]=(10**139)/(2**462) */
|
||||
ULL2(0xd910f7ff,0x28069da4), /* _Stl_tenpow[31]=(10**167)/(2**555) */
|
||||
ULL2(0xdb2e51bf,0xe9d0696a), /* _Stl_tenpow[32]=(10**195)/(2**648) */
|
||||
ULL2(0xdd50f199,0x6b947519), /* _Stl_tenpow[33]=(10**223)/(2**741) */
|
||||
ULL2(0xdf78e4b2,0xbd342cf7), /* _Stl_tenpow[34]=(10**251)/(2**834) */
|
||||
ULL2(0xe1a63853,0xbbd26451), /* _Stl_tenpow[35]=(10**279)/(2**927) */
|
||||
ULL2(0xe3d8f9e5,0x63a198e5), /* _Stl_tenpow[36]=(10**307)/(2**1020) */
|
||||
|
||||
ULL2(0xfd87b5f2,0x8300ca0e), /* _Stl_tenpow[37]=(10**-28)/(2**-93) */
|
||||
ULL2(0xfb158592,0xbe068d2f), /* _Stl_tenpow[38]=(10**-56)/(2**-186) */
|
||||
ULL2(0xf8a95fcf,0x88747d94), /* _Stl_tenpow[39]=(10**-84)/(2**-279) */
|
||||
ULL2(0xf64335bc,0xf065d37d), /* _Stl_tenpow[40]=(10**-112)/(2**-372) */
|
||||
ULL2(0xf3e2f893,0xdec3f126), /* _Stl_tenpow[41]=(10**-140)/(2**-465) */
|
||||
ULL2(0xf18899b1,0xbc3f8ca2), /* _Stl_tenpow[42]=(10**-168)/(2**-558) */
|
||||
ULL2(0xef340a98,0x172aace5), /* _Stl_tenpow[43]=(10**-196)/(2**-651) */
|
||||
ULL2(0xece53cec,0x4a314ebe), /* _Stl_tenpow[44]=(10**-224)/(2**-744) */
|
||||
ULL2(0xea9c2277,0x23ee8bcb), /* _Stl_tenpow[45]=(10**-252)/(2**-837) */
|
||||
ULL2(0xe858ad24,0x8f5c22ca), /* _Stl_tenpow[46]=(10**-280)/(2**-930) */
|
||||
ULL2(0xe61acf03,0x3d1a45df), /* _Stl_tenpow[47]=(10**-308)/(2**-1023) */
|
||||
ULL2(0xe3e27a44,0x4d8d98b8), /* _Stl_tenpow[48]=(10**-336)/(2**-1116) */
|
||||
ULL2(0xe1afa13a,0xfbd14d6e) /* _Stl_tenpow[49]=(10**-364)/(2**-1209) */
|
||||
#endif
|
||||
};
|
||||
|
||||
static const short _Stl_twoexp[80] = {
|
||||
4,7,10,14,17,20,24,27,30,34,37,40,44,47,50,54,57,60,64,67,70,74,77,80,84,87,90,
|
||||
183,276,369,462,555,648,741,834,927,1020,
|
||||
-93,-186,-279,-372,-465,-558,-651,-744,-837,-930,-1023,-1116,-1209
|
||||
};
|
||||
|
||||
# define TEN_1 0 /* offset to 10 ** 1 */
|
||||
# define TEN_27 26 /* offset to 10 ** 27 */
|
||||
# define TEN_M28 37 /* offset to 10 ** -28 */
|
||||
# define NUM_HI_P 11
|
||||
# define NUM_HI_N 13
|
||||
|
||||
# define _Stl_HIBITULL (ULL(1) << 63)
|
||||
|
||||
void _Stl_norm_and_round(uint64& p, int& norm, uint64 prodhi, uint64 prodlo)
|
||||
{
|
||||
norm = 0;
|
||||
if( ! (prodhi & _Stl_HIBITULL) ) {
|
||||
/* leading bit is a zero
|
||||
* may have to normalize
|
||||
*/
|
||||
if(( prodhi == ~_Stl_HIBITULL) &&
|
||||
((prodlo >> 62) == 0x3) ) { /* normalization followed by round
|
||||
* would cause carry to create
|
||||
* extra bit, so don't normalize
|
||||
*/
|
||||
p = _Stl_HIBITULL;
|
||||
return;
|
||||
}
|
||||
p = (prodhi<<1) | (prodlo>>63); /* normalize */
|
||||
norm=1;
|
||||
prodlo <<= 1;
|
||||
}
|
||||
else {
|
||||
p = prodhi;
|
||||
}
|
||||
|
||||
if( (prodlo & _Stl_HIBITULL) != 0 ) { /* first guard bit a one */ //*TY 03/25/2000 - added explicit comparison to zero to avoid reliance to the implicit conversion from uint64 to bool
|
||||
#if !defined(__SC__) //*TY 03/25/2000 -
|
||||
if( ((p & 0x1) != 0) ||
|
||||
prodlo != _Stl_HIBITULL ) { /* not borderline for round to even */
|
||||
#else //*TY 03/25/2000 - added workaround for SCpp compiler
|
||||
bool b1 = ((p & 0x1) != 0);
|
||||
if( b1 || prodlo != _Stl_HIBITULL ) { //*TY 03/25/2000 - SCpp confuses on this particular original boolean expression
|
||||
#endif //*TY 03/25/2000 -
|
||||
/* round */
|
||||
p++;
|
||||
if(p==0)
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert a 64-bitb fraction * 10^exp to a 64-bit fraction * 2^bexp.
|
||||
// p: 64-bit fraction
|
||||
// exp: base-10 exponent
|
||||
// bexp: base-2 exponent (output parameter)
|
||||
|
||||
void _Stl_tenscale(uint64& p, int exp, int& bexp)
|
||||
{
|
||||
uint64 prodhi, prodlo; /* 128b product */
|
||||
int exp_hi, exp_lo; /* exp = exp_hi*32 + exp_lo */
|
||||
int hi, lo, tlo, thi; /* offsets in power of ten table */
|
||||
int norm; /* number of bits of normalization */
|
||||
int num_hi; /* number of high exponent powers */
|
||||
|
||||
bexp = 0;
|
||||
if(exp > 0) { /* split exponent */
|
||||
exp_lo = exp;
|
||||
exp_hi = 0;
|
||||
if(exp_lo>27) {
|
||||
exp_lo++;
|
||||
while(exp_lo>27) {
|
||||
exp_hi++;
|
||||
exp_lo-=28;
|
||||
}
|
||||
}
|
||||
tlo = TEN_1;
|
||||
thi = TEN_27;
|
||||
num_hi = NUM_HI_P;
|
||||
}
|
||||
else if(exp < 0) {
|
||||
exp_lo = exp;
|
||||
exp_hi = 0;
|
||||
while(exp_lo<0) {
|
||||
exp_hi++;
|
||||
exp_lo+=28;
|
||||
}
|
||||
tlo = TEN_1;
|
||||
thi = TEN_M28;
|
||||
num_hi = NUM_HI_N;
|
||||
}
|
||||
else { /* no scaling needed */
|
||||
return;
|
||||
}
|
||||
while(exp_hi) { /* scale */
|
||||
hi = (min) (exp_hi,num_hi); /* only a few large powers of 10 */
|
||||
exp_hi -= hi; /* could iterate in extreme case */
|
||||
hi += thi-1;
|
||||
_Stl_mult64(p, _Stl_tenpow[hi], prodhi, prodlo);
|
||||
_Stl_norm_and_round(p, norm, prodhi, prodlo);
|
||||
bexp += _Stl_twoexp[hi] - norm;
|
||||
}
|
||||
if(exp_lo) {
|
||||
lo = tlo + exp_lo -1;
|
||||
_Stl_mult64(p, _Stl_tenpow[lo], prodhi, prodlo);
|
||||
_Stl_norm_and_round(p, norm, prodhi, prodlo);
|
||||
bexp += _Stl_twoexp[lo] - norm;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// First argument is a buffer of values from 0 to 9, NOT ascii.
|
||||
// Second argument is number of digits in buffer, 1 <= digits <= 17.
|
||||
// Third argument is base-10 exponent.
|
||||
|
||||
#if defined(__SC__) || defined(__MRC__)
|
||||
|
||||
//*TY 04/06/2000 - powermac's 68K emulator utilizes apple's SANE floating point, which is not compatible with IEEE format.
|
||||
_STLP_END_NAMESPACE
|
||||
# include <fp.h>
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
inline double _Stl_atod(char *buffer, int ndigit, int dexp)
|
||||
{
|
||||
decimal d; // ref. inside macintosh powerpc numerics p.9-13
|
||||
|
||||
d.sgn = 0;
|
||||
d.exp = dexp;
|
||||
d.sig.length = ndigit;
|
||||
for( int i = 0; i < ndigit; ++i )
|
||||
{
|
||||
d.sig.text[i] = buffer[i] + '0';
|
||||
}
|
||||
return dec2num( &d );
|
||||
}
|
||||
|
||||
#else /* IEEE representation */
|
||||
|
||||
#if 0 // def __ICL
|
||||
// turn off optimization here
|
||||
# pragma optimize "off"
|
||||
#endif
|
||||
|
||||
double _Stl_atod(char *buffer, int ndigit, int dexp)
|
||||
{
|
||||
|
||||
uint64 value; /* Value develops as follows:
|
||||
* 1) decimal digits as an integer
|
||||
* 2) left adjusted fraction
|
||||
* 3) right adjusted fraction
|
||||
* 4) exponent and fraction
|
||||
*/
|
||||
|
||||
uint32 guard; /* First guard bit */
|
||||
uint64 rest; /* Remaining guard bits */
|
||||
|
||||
int bexp; /* binary exponent */
|
||||
int nzero; /* number of non-zero bits */
|
||||
int sexp; /* scaling exponent */
|
||||
|
||||
char *bufferend; /* pointer to char after last digit */
|
||||
|
||||
/* Check for zero and treat it as a special case */
|
||||
|
||||
if (buffer == 0){
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/* Convert the decimal digits to a binary integer. */
|
||||
|
||||
bufferend = buffer + ndigit;
|
||||
value = 0;
|
||||
|
||||
while( buffer < bufferend ) {
|
||||
value *= 10;
|
||||
value += *buffer++;
|
||||
}
|
||||
|
||||
/* Check for zero and treat it as a special case */
|
||||
|
||||
if (value == 0){
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/* Normalize value */
|
||||
|
||||
bexp = 64; /* convert from 64b int to fraction */
|
||||
|
||||
/* Count number of non-zeroes in value */
|
||||
nzero = 0;
|
||||
if ( (value >> 32) !=0 ){ nzero = 32; } //*TY 03/25/2000 - added explicit comparison to zero to avoid uint64 to bool conversion operator
|
||||
if ( (value >> (16 + nzero)) !=0 ){ nzero += 16; }
|
||||
if ( (value >> ( 8 + nzero)) !=0 ){ nzero += 8; }
|
||||
if ( (value >> ( 4 + nzero)) !=0 ){ nzero += 4; }
|
||||
if ( (value >> ( 2 + nzero)) !=0 ){ nzero += 2; }
|
||||
if ( (value >> ( 1 + nzero)) !=0 ){ nzero += 1; }
|
||||
if ( (value >> ( nzero)) !=0 ){ nzero += 1; }
|
||||
|
||||
/* Normalize */
|
||||
value <<= /*(uint64)*/ (64-nzero); //*TY 03/25/2000 - removed extraneous cast to uint64
|
||||
bexp -= 64-nzero;
|
||||
|
||||
/* At this point we have a 64b fraction and a binary exponent
|
||||
* but have yet to incorporate the decimal exponent.
|
||||
*/
|
||||
|
||||
/* multiply by 10^dexp */
|
||||
|
||||
_Stl_tenscale(value, dexp, sexp);
|
||||
bexp += sexp;
|
||||
|
||||
if (bexp <= -1022) { /* HI denorm or underflow */
|
||||
bexp += 1022;
|
||||
if( bexp < -53 ) { /* guaranteed underflow */
|
||||
value = 0;
|
||||
}
|
||||
else { /* denorm or possible underflow */
|
||||
int lead0;
|
||||
|
||||
lead0 = 12-bexp; /* 12 sign and exponent bits */
|
||||
|
||||
/* we must special case right shifts of more than 63 */
|
||||
|
||||
if ( lead0 > 64 )
|
||||
{
|
||||
rest = value;
|
||||
guard = 0;
|
||||
value = 0;
|
||||
}
|
||||
else if ( lead0 == 64 )
|
||||
{
|
||||
rest = value & ((ULL(1)<< 63)-1);
|
||||
#if !defined(__SC__)
|
||||
guard = (uint32) ((value>> 63) & 1 );
|
||||
#else
|
||||
guard = to_ulong((value>> 63) & 1 ); //*TY 03/25/2000 - use member function instead of problematic conversion operator utilization
|
||||
#endif
|
||||
value = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
rest = value & (((ULL(1) << lead0)-1)-1);
|
||||
#if !defined(__SC__)
|
||||
guard = (uint32) (((value>> lead0)-1) & 1);
|
||||
#else //*TY 03/25/2000 -
|
||||
guard = to_ulong(((value>> lead0)-1) & 1);
|
||||
#endif //*TY 03/25/2000 -
|
||||
value >>= /*(uint64)*/ lead0; /* exponent is zero */
|
||||
}
|
||||
|
||||
/* Round */
|
||||
if ( guard && ( (value&1) || rest) ) {
|
||||
value++;
|
||||
if( value == (ULL(1) << 52) ) { /* carry created normal number */
|
||||
value = 0;
|
||||
_Stl_set_exponent(value, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else { /* not zero or denorm */
|
||||
/* Round to 53 bits */
|
||||
|
||||
rest = value & (1<<10)-1;
|
||||
value >>= 10;
|
||||
#if !defined(__SC__)
|
||||
guard = (uint32) value & 1;
|
||||
#else //*TY 03/25/2000 -
|
||||
guard = to_ulong(value & 1);
|
||||
#endif
|
||||
value >>= 1;
|
||||
|
||||
/* value&1 guard rest Action
|
||||
*
|
||||
* dc 0 dc none
|
||||
* 1 1 dc round
|
||||
* 0 1 0 none
|
||||
* 0 1 !=0 round
|
||||
*/
|
||||
if(guard) {
|
||||
if(((value&1)!=0) || (rest!=0)) {
|
||||
value++; /* round */
|
||||
if((value>>53)!=0) { /* carry all the way across */
|
||||
value >>= 1; /* renormalize */
|
||||
bexp ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check for overflow
|
||||
* IEEE Double Precision Format
|
||||
* (From Table 7-8 of Kane and Heinrich)
|
||||
*
|
||||
* Fraction bits 52
|
||||
* Emax +1023
|
||||
* Emin -1022
|
||||
* Exponent bias +1023
|
||||
* Exponent bits 11
|
||||
* Integer bit hidden
|
||||
* Total width in bits 64
|
||||
*/
|
||||
|
||||
if (bexp > 1024) { /* overflow */
|
||||
return numeric_limits<double>::infinity();
|
||||
}
|
||||
else { /* value is normal */
|
||||
value &= ~(ULL(1) << 52); /* hide hidden bit */
|
||||
_Stl_set_exponent(value, bexp + 1022); /* add bias */
|
||||
}
|
||||
}
|
||||
|
||||
return *((double *) &value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
double _Stl_string_to_double(const char * s) {
|
||||
const int max_digits = 17;
|
||||
unsigned c;
|
||||
unsigned Negate, decimal_point;
|
||||
char *d;
|
||||
int exp;
|
||||
double x;
|
||||
int dpchar;
|
||||
char digits[max_digits];
|
||||
|
||||
// Skip leading whitespace, if any.
|
||||
const ctype<char>& ct = use_facet<ctype<char> >(locale::classic());
|
||||
while (c = *s++, ct.is(ctype_base::space, char(c)))
|
||||
;
|
||||
|
||||
/* process sign */
|
||||
Negate = 0;
|
||||
if (c == '+') {
|
||||
c = *s++;
|
||||
}
|
||||
else if (c == '-') {
|
||||
Negate = 1;
|
||||
c = *s++;
|
||||
}
|
||||
d = digits;
|
||||
dpchar = '.' - '0';
|
||||
decimal_point = 0;
|
||||
exp = 0;
|
||||
for (;;) {
|
||||
c -= '0';
|
||||
if (c < 10) {
|
||||
if (d == digits+max_digits) {
|
||||
/* ignore more than 17 digits, but adjust exponent */
|
||||
exp += (decimal_point ^ 1);
|
||||
}
|
||||
else {
|
||||
if (c == 0 && d == digits) {
|
||||
/* ignore leading zeros */
|
||||
}
|
||||
else {
|
||||
*d++ = (char) c;
|
||||
}
|
||||
exp -= decimal_point;
|
||||
}
|
||||
}
|
||||
else if (c == (unsigned int) dpchar && !decimal_point) { /* INTERNATIONAL */
|
||||
decimal_point = 1;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
c = *s++;
|
||||
}
|
||||
/* strtod cant return until it finds the end of the exponent */
|
||||
if (d == digits) {
|
||||
return 0.0;
|
||||
}
|
||||
if (c == 'e'-'0' || c == 'E'-'0') {
|
||||
register unsigned negate_exp = 0;
|
||||
register int e = 0;
|
||||
c = *s++;
|
||||
if (c == '+' || c == ' ') {
|
||||
c = *s++;
|
||||
}
|
||||
else if (c == '-') {
|
||||
negate_exp = 1;
|
||||
c = *s++;
|
||||
}
|
||||
if (c -= '0', c < 10) {
|
||||
do {
|
||||
if (e <= 340)
|
||||
e = e * 10 + (int)c;
|
||||
else break;
|
||||
c = *s++;
|
||||
}
|
||||
while (c -= '0', c < 10);
|
||||
if (negate_exp) {
|
||||
e = -e;
|
||||
}
|
||||
if (e < -340 || e > 340)
|
||||
exp = e;
|
||||
else
|
||||
exp += e;
|
||||
}
|
||||
}
|
||||
|
||||
if (exp < -340) {
|
||||
x = 0;
|
||||
}
|
||||
else if (exp > 308) {
|
||||
x = numeric_limits<double>::infinity();
|
||||
}
|
||||
else {
|
||||
/* let _Stl_atod diagnose under- and over-flows */
|
||||
/* if the input was == 0.0, we have already returned,
|
||||
so retval of +-Inf signals OVERFLOW, 0.0 UNDERFLOW
|
||||
*/
|
||||
x = _Stl_atod (digits, (int)(d - digits), exp);
|
||||
}
|
||||
if (Negate) {
|
||||
x = -x;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
/*
|
||||
* __string_to_long_double is just lifted from atold, the difference being
|
||||
* that we just use '.' for the decimal point, rather than let it
|
||||
* be taken from the current C locale, which of course is not accessible
|
||||
* to us.
|
||||
*/
|
||||
|
||||
long double
|
||||
_Stl_string_to_long_double(const char * s) {
|
||||
const int max_digits = 34;
|
||||
register unsigned c;
|
||||
register unsigned Negate, decimal_point;
|
||||
register char *d;
|
||||
register int exp;
|
||||
long double x;
|
||||
register int dpchar;
|
||||
char digits[max_digits];
|
||||
|
||||
const ctype<char>& ct = use_facet<ctype<char> >(locale::classic());
|
||||
while (c = *s++, ct.is(ctype_base::space, char(c)))
|
||||
;
|
||||
|
||||
/* process sign */
|
||||
Negate = 0;
|
||||
if (c == '+') {
|
||||
c = *s++;
|
||||
}
|
||||
else if (c == '-') {
|
||||
Negate = 1;
|
||||
c = *s++;
|
||||
}
|
||||
|
||||
d = digits;
|
||||
dpchar = '.' -'0';
|
||||
decimal_point = 0;
|
||||
exp = 0;
|
||||
|
||||
for (;;) {
|
||||
c -= '0';
|
||||
if (c < 10) {
|
||||
if (d == digits+max_digits) {
|
||||
/* ignore more than 34 digits, but adjust exponent */
|
||||
exp += (decimal_point ^ 1);
|
||||
}
|
||||
else {
|
||||
if (c == 0 && d == digits) {
|
||||
/* ignore leading zeros */
|
||||
;
|
||||
}
|
||||
else {
|
||||
*d++ = c;
|
||||
}
|
||||
exp -= decimal_point;
|
||||
}
|
||||
}
|
||||
else if (c == dpchar && !decimal_point) { /* INTERNATIONAL */
|
||||
decimal_point = 1;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
c = *s++;
|
||||
} /* for */
|
||||
|
||||
if (d == digits) {
|
||||
return 0.0L;
|
||||
}
|
||||
if (c == 'e'-'0' || c == 'E'-'0') {
|
||||
register unsigned negate_exp = 0;
|
||||
register int e = 0;
|
||||
c = *s++;
|
||||
if (c == '+' || c == ' ') {
|
||||
c = *s++;
|
||||
}
|
||||
else if (c == '-') {
|
||||
negate_exp = 1;
|
||||
c = *s++;
|
||||
}
|
||||
if (c -= '0', c < 10) {
|
||||
do {
|
||||
if (e <= 340)
|
||||
e = e * 10 + c;
|
||||
else break;
|
||||
c = *s++;
|
||||
}
|
||||
while (c -= '0', c < 10);
|
||||
if (negate_exp) {
|
||||
e = -e;
|
||||
}
|
||||
if (e < -(323+max_digits) || e > 308)
|
||||
exp = e;
|
||||
else
|
||||
exp += e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (exp < -(324+max_digits)) {
|
||||
x = 0;
|
||||
}
|
||||
else if (exp > 308) {
|
||||
x = numeric_limits<long double>::infinity();
|
||||
}
|
||||
else {
|
||||
/* let _Stl_atod diagnose under- and over-flows */
|
||||
/* if the input was == 0.0, we have already returned,
|
||||
so retval of +-Inf signals OVERFLOW, 0.0 UNDERFLOW
|
||||
*/
|
||||
|
||||
// x = _Stl_atod (digits, (int)(d - digits), exp); // TEMPORARY!!:1
|
||||
double tmp = _Stl_atod (digits, (int)(d - digits), exp); // TEMPORARY!!:1
|
||||
x = tmp == numeric_limits<double>::infinity()
|
||||
? numeric_limits<long double>::infinity()
|
||||
: tmp;
|
||||
}
|
||||
|
||||
if (Negate) {
|
||||
x = -x;
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
void _STLP_CALL
|
||||
__string_to_float(const string& v, float& val) {
|
||||
val = _Stl_string_to_double(v.data());
|
||||
}
|
||||
|
||||
void _STLP_CALL
|
||||
__string_to_float(const string& v, double& val) {
|
||||
val = _Stl_string_to_double(v.data());
|
||||
}
|
||||
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
void _STLP_CALL
|
||||
__string_to_float(const string& v, long double& val) {
|
||||
val = _Stl_string_to_long_double(v.data());
|
||||
}
|
||||
#endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
83
STLPORT/src/num_put.cpp
Normal file
83
STLPORT/src/num_put.cpp
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
# include "num_put.h"
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// num_put
|
||||
|
||||
extern const char __hex_char_table_lo[];
|
||||
extern const char __hex_char_table_hi[];
|
||||
|
||||
const char __hex_char_table_lo[18] = "0123456789abcdefx";
|
||||
const char __hex_char_table_hi[18] = "0123456789ABCDEFX";
|
||||
|
||||
char* _STLP_CALL
|
||||
__write_integer(char* buf, ios_base::fmtflags flags, long x)
|
||||
{
|
||||
char tmp[64];
|
||||
char* bufend = tmp+64;
|
||||
char* beg = __write_integer_backward(bufend, flags, x);
|
||||
return copy(beg, bufend, buf);
|
||||
}
|
||||
|
||||
///-------------------------------------
|
||||
|
||||
ptrdiff_t _STLP_CALL
|
||||
__insert_grouping(char * first, char * last, const string& grouping,
|
||||
char separator, char Plus, char Minus, int basechars)
|
||||
{
|
||||
return __insert_grouping_aux(first, last, grouping,
|
||||
separator, Plus, Minus, basechars);
|
||||
}
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
ptrdiff_t _STLP_CALL
|
||||
__insert_grouping(wchar_t* first, wchar_t* last, const string& grouping,
|
||||
wchar_t separator, wchar_t Plus, wchar_t Minus,
|
||||
int basechars)
|
||||
{
|
||||
return __insert_grouping_aux(first, last, grouping, separator,
|
||||
Plus, Minus, basechars);
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Force instantiation of num_put<>
|
||||
#if !defined(_STLP_NO_FORCE_INSTANTIATE)
|
||||
template class _STLP_CLASS_DECLSPEC ostreambuf_iterator<char, char_traits<char> >;
|
||||
// template class num_put<char, char*>;
|
||||
template class num_put<char, ostreambuf_iterator<char, char_traits<char> > >;
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
template class ostreambuf_iterator<wchar_t, char_traits<wchar_t> >;
|
||||
template class num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >;
|
||||
// template class num_put<wchar_t, wchar_t*>;
|
||||
# endif /* INSTANTIATE_WIDE_STREAMS */
|
||||
#endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
77
STLPORT/src/num_put.h
Normal file
77
STLPORT/src/num_put.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# ifndef _STLP_NUM_PUT_H
|
||||
# define _STLP_NUM_PUT_H
|
||||
|
||||
#ifndef _STLP_INTERNAL_NUM_PUT_H
|
||||
#include <stl/_num_put.h>
|
||||
#endif
|
||||
#ifndef _STLP_INTERNAL_OSTREAM_H
|
||||
#include <stl/_ostream.h>
|
||||
#endif
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
// Note that grouping[0] is the number of digits in the *rightmost* group.
|
||||
// We assume, without checking, that *last is null and that there is enough
|
||||
// space in the buffer to extend the number past [first, last).
|
||||
template <class Char>
|
||||
ptrdiff_t
|
||||
__insert_grouping_aux(Char* first, Char* last, const string& grouping,
|
||||
Char separator, Char Plus, Char Minus,
|
||||
int basechars)
|
||||
{
|
||||
typedef string::size_type str_size;
|
||||
|
||||
if (first == last)
|
||||
return 0;
|
||||
|
||||
int sign = 0;
|
||||
|
||||
if (*first == Plus || *first == Minus) {
|
||||
sign = 1;
|
||||
++first;
|
||||
}
|
||||
|
||||
first += basechars;
|
||||
str_size n = 0; // Index of the current group.
|
||||
Char* cur_group = last; // Points immediately beyond the rightmost
|
||||
// digit of the current group.
|
||||
int groupsize = 0; // Size of the current group.
|
||||
|
||||
while (true) {
|
||||
groupsize = n < grouping.size() ? grouping[n] : groupsize;
|
||||
++n;
|
||||
|
||||
if (groupsize <= 0 || groupsize >= cur_group - first)
|
||||
break;
|
||||
|
||||
// Insert a separator character just before position cur_group - groupsize
|
||||
cur_group -= groupsize;
|
||||
++last;
|
||||
copy_backward(cur_group, last, last + 1);
|
||||
*cur_group = separator;
|
||||
}
|
||||
|
||||
return (last - first) + sign + basechars;
|
||||
}
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
# endif
|
||||
762
STLPORT/src/num_put_float.cpp
Normal file
762
STLPORT/src/num_put_float.cpp
Normal file
@@ -0,0 +1,762 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
# ifdef __DECCXX
|
||||
#define NDIG 400
|
||||
# else
|
||||
#define NDIG 82
|
||||
# endif
|
||||
|
||||
# ifdef _STLP_NO_LONG_DOUBLE
|
||||
# define MAXECVT 17
|
||||
# define MAXFCVT 18
|
||||
typedef double max_double_type;
|
||||
# else
|
||||
# define MAXECVT 35
|
||||
# define MAXFCVT 36
|
||||
typedef long double max_double_type;
|
||||
# endif
|
||||
|
||||
#define MAXFSIG MAXECVT
|
||||
#define MAXESIZ 5
|
||||
|
||||
#define todigit(x) ((x)+'0')
|
||||
|
||||
# include <stl/_config.h>
|
||||
|
||||
# ifdef _STLP_UNIX
|
||||
|
||||
# if defined (__sun)
|
||||
# include <floatingpoint.h>
|
||||
# endif
|
||||
|
||||
//# if !(defined(_STLP_USE_GLIBC) || defined(__FreeBSD__) || defined(__NetBSD__) || defined (_AIX) || defined(__MVS__) || defined (__OS400__) || defined (__QNXNTO__) || defined (__APPLE__) || defined (__DJGPP))
|
||||
# if defined (__sun) || defined (__digital__) || defined (__sgi) || defined (_STLP_SCO_OPENSERVER) || defined (__NCR_SVR)
|
||||
// DEC, SGI & Solaris need this
|
||||
# include <values.h>
|
||||
# include <nan.h>
|
||||
# endif
|
||||
|
||||
# if defined (__QNXNTO__) || ( defined(__GNUC__) && defined(__APPLE__) )
|
||||
# define USE_SPRINTF_INSTEAD
|
||||
# endif
|
||||
|
||||
# if defined( _AIX ) // JFA 3-Aug-2000
|
||||
# include <math.h>
|
||||
# include <float.h>
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
# include <cstdlib>
|
||||
|
||||
//#if defined(_CRAY)
|
||||
//# include <stdlib.h>
|
||||
//#endif
|
||||
|
||||
#if defined (_MSC_VER) || defined (__MINGW32__) || defined (__BORLANDC__) || defined (__DJGPP) || defined (_STLP_SCO_OPENSERVER) || defined (__NCR_SVR)
|
||||
# include <float.h>
|
||||
#endif
|
||||
|
||||
#if defined(__MRC__) || defined(__SC__) || defined(_CRAY) //*TY 02/24/2000 - added support for MPW
|
||||
# include <fp.h>
|
||||
#endif
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#if defined( __MSL__ )
|
||||
# include <cstdlib> // for atoi
|
||||
# include <cstdio> // for snprintf
|
||||
# include <algorithm>
|
||||
# include <cassert>
|
||||
#endif
|
||||
|
||||
#if defined (__ISCPP__)
|
||||
# include <cfloat>
|
||||
#endif
|
||||
|
||||
|
||||
# include "num_put.h"
|
||||
# include <algorithm>
|
||||
|
||||
|
||||
#if defined(__hpux) && !defined(_INCLUDE_HPUX_SOURCE)
|
||||
extern "C" double erf(double);
|
||||
extern "C" double erfc(double);
|
||||
extern "C" double gamma(double); /* obsolescent */
|
||||
extern "C" double hypot(double, double);
|
||||
extern "C" int isnan(double);
|
||||
extern "C" double j0(double);
|
||||
extern "C" double j1(double);
|
||||
extern "C" double jn(int, double);
|
||||
extern "C" double lgamma(double);
|
||||
extern "C" double y0(double);
|
||||
extern "C" double y1(double);
|
||||
extern "C" double yn(int, double);
|
||||
|
||||
# define HUGE_VALF _SINFINITY
|
||||
# define INFINITY _SINFINITY
|
||||
# define NAN _SQNAN
|
||||
|
||||
# define isnan(x) _ISNAN(x)
|
||||
# define isinf(x) _ISINF(x)
|
||||
# define signbit(x) _SIGNBIT(x)
|
||||
# define isfinite(x) _ISFINITE(x)
|
||||
# define isnormal(x) _ISNORMAL(x)
|
||||
# define fpclassify(x) _FPCLASSIFY(x)
|
||||
# define isunordered(x,y) _ISUNORDERED(x,y)
|
||||
# define isgreater(x,y) _ISGREATER(x,y)
|
||||
# define isgreaterequal(x,y) _ISGREATEREQUAL(x,y)
|
||||
# define isless(x,y) _ISLESS(x,y)
|
||||
# define islessequal(x,y) _ISLESSEQUAL(x,y)
|
||||
# define islessgreater(x,y) _ISLESSGREATER(x,y)
|
||||
|
||||
# define FP_NORMAL 0
|
||||
# define FP_ZERO 1
|
||||
# define FP_INFINITE 2
|
||||
# define FP_SUBNORMAL 3
|
||||
# define FP_NAN 4
|
||||
|
||||
# define DECIMAL_DIG 17
|
||||
|
||||
# define _IS64(x) (sizeof(x)==sizeof(double))
|
||||
# define _IS32(x) (sizeof(x)==sizeof(float))
|
||||
|
||||
extern "C" {
|
||||
extern double copysign(double, double);
|
||||
extern const float _SINFINITY;
|
||||
extern const float _SQNAN;
|
||||
# ifdef _PA_RISC
|
||||
# define _ISNAN(x) (_IS32(x)?_Isnanf(x):(isnan)(x))
|
||||
# define _ISINF(x) (_IS32(x)?_Isinff(x):_Isinf(x))
|
||||
# define _SIGNBIT(x) (_IS32(x)?_Signbitf(x):_Signbit(x))
|
||||
# define _ISFINITE(x) (_IS32(x)?_Isfinitef(x):_Isfinite(x))
|
||||
# define _ISNORMAL(x) (_IS32(x)?_Isnormalf(x):_Isnormal(x))
|
||||
# define _FPCLASSIFY(x) (_IS32(x)?_Fpclassifyf(x)>>1:_Fpclassify(x)>>1)
|
||||
# define _ISUNORDERED(x,y) (_IS32(x)&&_IS32(y)?_Isunorderedf(x,y):_Isunordered(x,y))
|
||||
extern int _Signbit(double);
|
||||
extern int _Signbitf(float);
|
||||
extern int _Isnanf(float);
|
||||
extern int _Isfinite(double);
|
||||
extern int _Isfinitef(float);
|
||||
extern int _Isinf(double);
|
||||
extern int _Isinff(float);
|
||||
extern int _Isnormal(double);
|
||||
extern int _Isnormalf(float);
|
||||
extern int _Isunordered(double, double);
|
||||
extern int _Isunorderedf(float, float);
|
||||
extern int _Fpclassify(double);
|
||||
extern int _Fpclassifyf(float);
|
||||
# else
|
||||
# include "math_ia64_internal.h"
|
||||
# define _FPCLASSIFY(x) (_IS32(x)?_Fpclassf(x):_Fpclass(x))
|
||||
extern int _Fpclass(double);
|
||||
extern int _Fpclassf(float);
|
||||
# endif
|
||||
}
|
||||
|
||||
#ifndef _INCLUDE_XOPEN_SOURCE_EXTENDED
|
||||
extern "C" char *fcvt(double, int, int *, int *);
|
||||
extern "C" char *ecvt(double, int, int *, int *);
|
||||
#endif
|
||||
#ifndef _INCLUDE_HPUX_SOURCE
|
||||
# ifndef _LONG_DOUBLE
|
||||
# define _LONG_DOUBLE
|
||||
typedef struct {
|
||||
uint32_t word1, word2, word3, word4;
|
||||
} long_double;
|
||||
# endif /* _LONG_DOUBLE */
|
||||
extern "C" char *_ldecvt(long_double, int, int *, int *);
|
||||
extern "C" char *_ldfcvt(long_double, int, int *, int *);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __hpux */
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
#if defined (__MWERKS__) || defined(__BEOS__)
|
||||
# define USE_SPRINTF_INSTEAD
|
||||
#endif
|
||||
|
||||
# if defined (_AIX)
|
||||
// Some OS'es only provide non-reentrant primitives, so we have to use additional synchronization here
|
||||
# ifdef _REENTRANT
|
||||
static _STLP_STATIC_MUTEX __put_float_mutex _STLP_MUTEX_INITIALIZER;
|
||||
# define LOCK_CVT _STLP_auto_lock lock(__put_float_mutex);
|
||||
# define RETURN_CVT(ecvt, x, n, pt, sign, buf) strcpy(buf, ecvt(x, n, pt, sign)); return buf;
|
||||
# else
|
||||
# define LOCK_CVT
|
||||
# define RETURN_CVT(ecvt, x, n, pt, sign, buf) return ecvt(x, n, pt, sign);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
// Tests for infinity and NaN differ on different OSs. We encapsulate
|
||||
// these differences here.
|
||||
|
||||
#ifdef USE_SPRINTF_INSTEAD
|
||||
|
||||
#elif defined (__hpux) || defined (__DJGPP) || ( defined(_STLP_USE_GLIBC) && ! defined (__MSL__) )
|
||||
# if defined (isfinite)
|
||||
inline bool _Stl_is_nan_or_inf(double x) { return !isfinite(x); }
|
||||
# else
|
||||
inline bool _Stl_is_nan_or_inf(double x) { return !finite(x); }
|
||||
# endif
|
||||
inline bool _Stl_is_neg_nan(double x) { return isnan(x) && ( copysign(1., x) < 0 ); }
|
||||
inline bool _Stl_is_inf(double x) { return isinf(x); }
|
||||
// inline bool _Stl_is_neg_inf(double x) { return isinf(x) < 0; }
|
||||
inline bool _Stl_is_neg_inf(double x) { return isinf(x) && x < 0; }
|
||||
#elif defined(__unix) && !defined(__FreeBSD__) && !defined(__NetBSD__) \
|
||||
&& !defined(__APPLE__) && !defined(__DJGPP) && !defined(__osf__) \
|
||||
&& !defined(_CRAY)
|
||||
inline bool _Stl_is_nan_or_inf(double x) { return IsNANorINF(x); }
|
||||
inline bool _Stl_is_inf(double x) { return IsNANorINF(x) && IsINF(x); }
|
||||
inline bool _Stl_is_neg_inf(double x) { return (IsINF(x)) && (x < 0.0); }
|
||||
inline bool _Stl_is_neg_nan(double x) { return IsNegNAN(x); }
|
||||
# elif defined (__BORLANDC__) && ( __BORLANDC__ < 0x540 )
|
||||
inline bool _Stl_is_nan_or_inf(double x) { return !_finite(x); }
|
||||
inline bool _Stl_is_inf(double x) { return _Stl_is_nan_or_inf(x) && ! _isnan(x);}
|
||||
inline bool _Stl_is_neg_inf(double x) { return _Stl_is_inf(x) && x < 0 ; }
|
||||
inline bool _Stl_is_neg_nan(double x) { return _isnan(x) && x < 0 ; }
|
||||
#elif defined (_MSC_VER) || defined (__MINGW32__) || defined (__BORLANDC__)
|
||||
inline bool _Stl_is_nan_or_inf(double x) { return !_finite(x); }
|
||||
inline bool _Stl_is_inf(double x) {
|
||||
int fclass = _fpclass(x);
|
||||
return fclass == _FPCLASS_NINF || fclass == _FPCLASS_PINF;
|
||||
}
|
||||
inline bool _Stl_is_neg_inf(double x) { return _fpclass(x) == _FPCLASS_NINF; }
|
||||
inline bool _Stl_is_neg_nan(double x) { return _isnan(x) && _copysign(1., x) < 0 ; }
|
||||
#elif defined(__MRC__) || defined(__SC__) //*TY 02/24/2000 - added support for MPW
|
||||
bool _Stl_is_nan_or_inf(double x) { return isnan(x) || !isfinite(x); }
|
||||
bool _Stl_is_inf(double x) { return !isfinite(x); }
|
||||
bool _Stl_is_neg_inf(double x) { return !isfinite(x) && signbit(x); }
|
||||
bool _Stl_is_neg_nan(double x) { return isnan(x) && signbit(x); }
|
||||
#elif /* defined (__FreeBSD__) */ ( defined (__GNUC__) && defined (__APPLE__) )
|
||||
inline bool _Stl_is_nan_or_inf(double x) { return !finite(x); }
|
||||
inline bool _Stl_is_inf(double x) { return _Stl_is_nan_or_inf(x) && ! isnan(x); }
|
||||
inline bool _Stl_is_neg_inf(double x) { return _Stl_is_inf(x) && x < 0 ; }
|
||||
inline bool _Stl_is_neg_nan(double x) { return isnan(x) && copysign(1., x) < 0 ; }
|
||||
#elif defined( _AIX ) // JFA 11-Aug-2000
|
||||
bool _Stl_is_nan_or_inf(double x) { return isnan(x) || !finite(x); }
|
||||
bool _Stl_is_inf(double x) { return !finite(x); }
|
||||
// bool _Stl_is_neg_inf(double x) { return _class(x) == FP_MINUS_INF; }
|
||||
bool _Stl_is_neg_inf(double x) { return _Stl_is_inf(x) && ( copysign(1., x) < 0 ); }
|
||||
bool _Stl_is_neg_nan(double x) { return isnan(x) && ( copysign(1., x) < 0 ); }
|
||||
#elif defined (__ISCPP__)
|
||||
inline bool _Stl_is_nan_or_inf (double x) { return _fp_isINF(x) || _fp_isNAN(x); }
|
||||
inline bool _Stl_is_inf (double x) { return _fp_isINF(x); }
|
||||
inline bool _Stl_is_neg_inf (double x) { return _fp_isINF(x) && x < 0; }
|
||||
inline bool _Stl_is_neg_nan (double x) { return _fp_isNAN(x) && x < 0; }
|
||||
#elif defined(_CRAY)
|
||||
#if defined(_CRAYIEEE)
|
||||
inline bool _Stl_is_nan_or_inf(double x) { return isnan(x) || isinf(x); }
|
||||
inline bool _Stl_is_inf(double x) { return isinf(x); }
|
||||
inline bool _Stl_is_neg_inf(double x) { return isinf(x) && signbit(x); }
|
||||
inline bool _Stl_is_neg_nan(double x) { return isnan(x) && signbit(x); }
|
||||
#else
|
||||
inline bool _Stl_is_nan_or_inf(double x) { return false; }
|
||||
inline bool _Stl_is_inf(double x) { return false; }
|
||||
inline bool _Stl_is_neg_inf(double x) { return false; }
|
||||
inline bool _Stl_is_neg_nan(double x) { return false; }
|
||||
#endif
|
||||
#elif ! defined (USE_SPRINTF_INSTEAD)
|
||||
# define USE_SPRINTF_INSTEAD
|
||||
#endif
|
||||
|
||||
|
||||
# ifndef USE_SPRINTF_INSTEAD
|
||||
// Reentrant versions of floating-point conversion functions. The argument
|
||||
// lists look slightly different on different operating systems, so we're
|
||||
// encapsulating the differences here.
|
||||
|
||||
#if defined (__CYGWIN__) || defined(__DJGPP)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return ecvtbuf(x, n, pt, sign, buf); }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return fcvtbuf(x, n, pt, sign, buf); }
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return ecvtbuf(x, n, pt, sign, buf); }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return fcvtbuf(x, n, pt, sign, buf); }
|
||||
# endif
|
||||
#elif defined (_STLP_USE_GLIBC)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return buf + ecvt_r(x, n, pt, sign, buf, NDIG+2); }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return buf + fcvt_r(x, n, pt, sign, buf, NDIG+2); }
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return buf + qecvt_r(x, n, pt, sign, buf, NDIG+2); }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return buf + qfcvt_r(x, n, pt, sign, buf, NDIG+2); }
|
||||
# endif
|
||||
#elif defined (_STLP_SCO_OPENSERVER) || defined (__NCR_SVR)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return ecvt(x, n, pt, sign); }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return fcvt(x, n, pt, sign); }
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return ecvtl(x, n, pt, sign); }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return fcvtl(x, n, pt, sign); }
|
||||
# endif
|
||||
#elif defined (__sun)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return econvert(x, n, pt, sign, buf); }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return fconvert(x, n, pt, sign, buf); }
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return qeconvert(&x, n, pt, sign, buf); }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return qfconvert(&x, n, pt, sign, buf); }
|
||||
# endif
|
||||
#elif defined (__DECCXX)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return (ecvt_r(x, n, pt, sign, buf, NDIG)==0 ? buf : 0); }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return (fcvt_r(x, n, pt, sign, buf, NDIG)==0 ? buf : 0); }
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
// fbp : no "long double" conversions !
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return (ecvt_r((double)x, n, pt, sign, buf, NDIG)==0 ? buf : 0) ; }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return (fcvt_r((double)x, n, pt, sign, buf, NDIG)==0 ? buf : 0); }
|
||||
# endif
|
||||
#elif defined (__hpux)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return ecvt(x, n, pt, sign); }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return fcvt(x, n, pt, sign); }
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
|
||||
# if defined( _REENTRANT ) && (defined(_PTHREADS_DRAFT4) || defined(PTHREAD_THREADS_MAX))
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return (_ldecvt_r(*(long_double*)&x, n, pt, sign, buf, NDIG+2)==0 ? buf : 0); }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return (_ldfcvt_r(*(long_double*)&x, n, pt, sign, buf, NDIG+2)==0 ? buf : 0); }
|
||||
# else
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return _ldecvt(*(long_double*)&x, n, pt, sign); }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return _ldfcvt(*(long_double*)&x, n, pt, sign); }
|
||||
# endif
|
||||
# endif
|
||||
#elif defined (_AIX)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ LOCK_CVT RETURN_CVT(ecvt, x, n, pt, sign, buf) }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ LOCK_CVT RETURN_CVT(fcvt, x, n, pt, sign, buf) }
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ LOCK_CVT RETURN_CVT(ecvt, x, n, pt, sign, buf) }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ LOCK_CVT RETURN_CVT(fcvt, x, n, pt, sign, buf) }
|
||||
# endif
|
||||
#elif defined (__unix) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_CRAY)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return ecvt_r(x, n, pt, sign, buf); }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return fcvt_r(x, n, pt, sign, buf); }
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return qecvt_r(x, n, pt, sign, buf); }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return qfcvt_r(x, n, pt, sign, buf); }
|
||||
# endif
|
||||
#elif defined (_MSC_VER) || defined (__MINGW32__) || defined (__BORLANDC__)
|
||||
// those guys claim _cvt functions being reentrant.
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf) { return _ecvt(x, n, pt, sign); }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf) { return _fcvt(x, n, pt, sign); }
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf) { return _ecvt((double)x, n, pt, sign); }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf) { return _fcvt((double)x, n, pt, sign); }
|
||||
# endif
|
||||
#elif defined (__ISCPP__)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return _fp_ecvt( x, n, pt, sign, buf); }
|
||||
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return _fp_fcvt(x, n, pt, sign, buf); }
|
||||
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return _fp_ecvt( x, n, pt, sign, buf); }
|
||||
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
|
||||
{ return _fp_fcvt(x, n, pt, sign, buf); }
|
||||
# endif
|
||||
#elif defined (__MRC__) || defined(__SC__) || defined(_CRAY)
|
||||
inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* )
|
||||
{ return ecvt( x, n, pt, sign ); }
|
||||
inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* )
|
||||
{ return fcvt(x, n, pt, sign); }
|
||||
#ifndef _STLP_NO_LONG_DOUBLE
|
||||
inline char* _Stl_qecvtR(long double x, int n, int* pt, int* sign, char* )
|
||||
{ return ecvt( x, n, pt, sign ); }
|
||||
inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* )
|
||||
{ return fcvt(x, n, pt, sign); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// num_put
|
||||
|
||||
// Helper functions for _M_do_put_float
|
||||
|
||||
// __format_float formats a mantissa and exponent as returned by
|
||||
// one of the conversion functions (ecvt_r, fcvt_r, qecvt_r, qfcvt_r)
|
||||
// according to the specified precision and format flags. This is
|
||||
// based on doprnt but is much simpler since it is concerned only
|
||||
// with floating point input and does not consider all formats. It
|
||||
// also does not deal with blank padding, which is handled by
|
||||
// __copy_float_and_fill.
|
||||
|
||||
void __format_float_scientific(char * buf, const char * bp,
|
||||
int decpt, int sign, bool is_zero,
|
||||
ios_base::fmtflags flags,
|
||||
int precision, bool /* islong */)
|
||||
{
|
||||
char * suffix;
|
||||
char expbuf[MAXESIZ + 2];
|
||||
// sign if required
|
||||
if (sign)
|
||||
*buf++ = '-';
|
||||
else if (flags & ios_base::showpos)
|
||||
*buf++ = '+';
|
||||
|
||||
// first digit of mantissa
|
||||
*buf++ = *bp++;
|
||||
|
||||
// decimal point if required
|
||||
if (precision != 0 || flags & ios_base::showpoint)
|
||||
*buf++ = '.';
|
||||
// rest of mantissa
|
||||
int rz = precision;
|
||||
while (rz-- > 0 && *bp != 0)
|
||||
*buf++ = *bp++;
|
||||
|
||||
// exponent
|
||||
*(suffix = &expbuf[MAXESIZ]) = 0;
|
||||
if (!is_zero) {
|
||||
int nn = decpt - 1;
|
||||
if (nn < 0)
|
||||
nn = -nn;
|
||||
for (; nn > 9; nn /= 10)
|
||||
*--suffix = (char) todigit(nn % 10);
|
||||
*--suffix = (char) todigit(nn);
|
||||
}
|
||||
|
||||
// prepend leading zeros to exponent
|
||||
while (suffix > &expbuf[MAXESIZ - 2])
|
||||
*--suffix = '0';
|
||||
|
||||
// put in the exponent sign
|
||||
*--suffix = (char) ((decpt > 0 || is_zero ) ? '+' : '-');
|
||||
|
||||
// put in the e
|
||||
*--suffix = flags & ios_base::uppercase ? 'E' : 'e';
|
||||
|
||||
// copy the suffix
|
||||
strcpy(buf, suffix);
|
||||
}
|
||||
|
||||
static inline
|
||||
void __flush_static_buf(string &buf,
|
||||
char *sbeginbuf, char *sendbuf, char *&scurpos) {
|
||||
if (scurpos == sendbuf) {
|
||||
buf.append(sbeginbuf, sendbuf);
|
||||
scurpos = sbeginbuf;
|
||||
}
|
||||
}
|
||||
|
||||
void __format_float_fixed(string &buf, const char * bp,
|
||||
int decpt, int sign, bool /* x */,
|
||||
ios_base::fmtflags flags,
|
||||
int precision, bool islong )
|
||||
{
|
||||
char static_buf[128];
|
||||
char *sbuf = static_buf;
|
||||
char *sendbuf = static_buf + sizeof(static_buf);
|
||||
|
||||
if (sign && decpt > -precision && *bp != 0)
|
||||
*sbuf++ = '-';
|
||||
else if (flags & ios_base::showpos)
|
||||
*sbuf++ = '+';
|
||||
|
||||
int rzero = 0;
|
||||
int nn = decpt;
|
||||
int k = 0;
|
||||
int maxfsig = islong ? 2*MAXFSIG : MAXFSIG;
|
||||
|
||||
do {
|
||||
*sbuf++ = (char) ((nn <= 0 || *bp == 0 || k >= maxfsig) ?
|
||||
'0' : (k++, *bp++));
|
||||
__flush_static_buf(buf, static_buf, sendbuf, sbuf);
|
||||
} while (--nn > 0);
|
||||
|
||||
// decimal point if needed
|
||||
if (flags & ios_base::showpoint || precision > 0) {
|
||||
*sbuf++ = '.';
|
||||
__flush_static_buf(buf, static_buf, sendbuf, sbuf);
|
||||
}
|
||||
|
||||
// digits after decimal point if any
|
||||
nn = (min) (precision, MAXFCVT);
|
||||
if (precision > nn)
|
||||
rzero = precision - nn;
|
||||
while (--nn >= 0) {
|
||||
*sbuf++ = (++decpt <= 0 || *bp == '\0' || k >= maxfsig)
|
||||
? '0' : (k++, *bp++);
|
||||
__flush_static_buf(buf, static_buf, sendbuf, sbuf);
|
||||
}
|
||||
|
||||
// trailing zeros if needed
|
||||
while (rzero-- > 0) {
|
||||
*sbuf++ = '0';
|
||||
__flush_static_buf(buf, static_buf, sendbuf, sbuf);
|
||||
}
|
||||
buf.append(static_buf, sbuf);
|
||||
}
|
||||
|
||||
|
||||
void __format_nan_or_inf(char * buf, double x,
|
||||
ios_base::fmtflags flags)
|
||||
{
|
||||
static const char* inf[2] = { "inf", "Inf" };
|
||||
static const char* nan[2] = { "nan", "NaN" };
|
||||
const char** inf_or_nan = 0;
|
||||
if (_Stl_is_inf((double)x)) { // Infinity
|
||||
inf_or_nan = inf;
|
||||
if (_Stl_is_neg_inf((double)x))
|
||||
*buf++ = '-';
|
||||
else if (flags & ios_base::showpos)
|
||||
*buf++ = '+';
|
||||
}
|
||||
else { // NaN
|
||||
inf_or_nan = nan;
|
||||
if (_Stl_is_neg_nan((double)x))
|
||||
*buf++ = '-';
|
||||
else if (flags & ios_base::showpos)
|
||||
*buf++ = '+';
|
||||
}
|
||||
strcpy(buf, flags & ios_base::uppercase ? inf_or_nan[1] : inf_or_nan[0]);
|
||||
}
|
||||
|
||||
template <class max_double_type>
|
||||
static inline
|
||||
void __format_float(string &buf, const char * bp,
|
||||
int decpt, int sign, max_double_type x,
|
||||
ios_base::fmtflags flags,
|
||||
int precision, bool islong)
|
||||
{
|
||||
char static_buf[128];
|
||||
// Output of infinities and NANs does not depend on the format flags
|
||||
if (_Stl_is_nan_or_inf((double)x)) { // Infinity or NaN
|
||||
__format_nan_or_inf(static_buf, x, flags);
|
||||
buf = static_buf;
|
||||
}
|
||||
else { // representable number
|
||||
switch (flags & ios_base::floatfield) {
|
||||
case ios_base::scientific:
|
||||
__format_float_scientific(static_buf, bp, decpt, sign, x == 0.0, flags,
|
||||
precision, islong);
|
||||
buf = static_buf;
|
||||
break;
|
||||
|
||||
case ios_base::fixed:
|
||||
__format_float_fixed(buf, bp, decpt, sign, true, flags,
|
||||
precision, islong);
|
||||
break;
|
||||
|
||||
default: // g format
|
||||
// establish default precision
|
||||
if (flags & ios_base::showpoint || precision > 0) {
|
||||
if (precision == 0) precision = 1;
|
||||
}
|
||||
else
|
||||
precision = 6;
|
||||
|
||||
// reset exponent if value is zero
|
||||
if (x == 0)
|
||||
decpt = 1;
|
||||
|
||||
int kk = precision;
|
||||
if (!(flags & ios_base::showpoint)) {
|
||||
size_t n = strlen(bp);
|
||||
if (n < kk)
|
||||
kk = (int)n;
|
||||
while (kk >= 1 && bp[kk-1] == '0')
|
||||
--kk;
|
||||
}
|
||||
|
||||
if (decpt < -3 || decpt > precision) {
|
||||
precision = kk - 1;
|
||||
__format_float_scientific(static_buf, bp, decpt, sign, x == 0,
|
||||
flags, precision, islong);
|
||||
buf = static_buf;
|
||||
}
|
||||
else {
|
||||
precision = kk - decpt;
|
||||
__format_float_fixed(buf, bp, decpt, sign, true,
|
||||
flags, precision, islong);
|
||||
}
|
||||
break;
|
||||
} /* switch */
|
||||
} /* else */
|
||||
}
|
||||
|
||||
# else
|
||||
// Creates a format string for sprintf()
|
||||
static int fill_fmtbuf(char* fmtbuf, ios_base::fmtflags flags, char long_modifier)
|
||||
{
|
||||
fmtbuf[0] = '%';
|
||||
int i = 1;
|
||||
|
||||
if (flags & ios_base::showpos)
|
||||
fmtbuf[i++] = '+';
|
||||
|
||||
if (flags & ios_base::showpoint)
|
||||
fmtbuf[i++] = '#';
|
||||
|
||||
fmtbuf[i++] = '.';
|
||||
fmtbuf[i++] = '*';
|
||||
|
||||
if (long_modifier)
|
||||
fmtbuf[i++] = long_modifier;
|
||||
|
||||
switch (flags & ios_base::floatfield)
|
||||
{
|
||||
case ios_base::scientific:
|
||||
fmtbuf[i++] = (flags & ios_base::uppercase) ? 'E' : 'e';
|
||||
break;
|
||||
case ios_base::fixed:
|
||||
#if defined (__FreeBSD__)
|
||||
fmtbuf[i++] = 'f';
|
||||
#else
|
||||
fmtbuf[i++] = (flags & ios_base::uppercase) ? 'F' : 'f';
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
fmtbuf[i++] = (flags & ios_base::uppercase) ? 'G' : 'g';
|
||||
break;
|
||||
}
|
||||
|
||||
fmtbuf[i] = 0;
|
||||
return i;
|
||||
}
|
||||
# endif /* USE_SPRINTF_INSTEAD */
|
||||
|
||||
|
||||
void _STLP_CALL
|
||||
__write_float(string &buf, ios_base::fmtflags flags, int precision,
|
||||
double x)
|
||||
{
|
||||
# ifdef USE_SPRINTF_INSTEAD
|
||||
char static_buf[128];
|
||||
char fmtbuf[32];
|
||||
fill_fmtbuf(fmtbuf, flags, 0);
|
||||
sprintf(static_buf, fmtbuf, precision, x);
|
||||
// we should be able to return static_buf + sprintf(), but we do not trust'em...
|
||||
buf = static_buf;
|
||||
# else
|
||||
char cvtbuf[NDIG+2];
|
||||
char * bp;
|
||||
int decpt, sign;
|
||||
|
||||
switch (flags & ios_base::floatfield) {
|
||||
case ios_base::fixed:
|
||||
bp = _Stl_fcvtR(x, (min) (precision, MAXFCVT), &decpt, &sign, cvtbuf);
|
||||
break;
|
||||
case ios_base::scientific :
|
||||
bp = _Stl_ecvtR(x, (min) (precision + 1, MAXECVT), &decpt, &sign, cvtbuf);
|
||||
break;
|
||||
default :
|
||||
bp = _Stl_ecvtR(x, (min) (precision, MAXECVT), &decpt, &sign, cvtbuf);
|
||||
break;
|
||||
}
|
||||
__format_float(buf, bp, decpt, sign, x, flags, precision, false);
|
||||
# endif
|
||||
|
||||
}
|
||||
|
||||
# ifndef _STLP_NO_LONG_DOUBLE
|
||||
void _STLP_CALL
|
||||
__write_float(string &buf, ios_base::fmtflags flags, int precision,
|
||||
long double x)
|
||||
{
|
||||
# ifdef USE_SPRINTF_INSTEAD
|
||||
char static_buf[128];
|
||||
char fmtbuf[64];
|
||||
int i = fill_fmtbuf(fmtbuf, flags, 'L');
|
||||
sprintf(static_buf, fmtbuf, precision, x);
|
||||
// we should be able to return buf + sprintf(), but we do not trust'em...
|
||||
buf = static_buf;
|
||||
# else
|
||||
char cvtbuf[NDIG+2];
|
||||
char * bp;
|
||||
int decpt, sign;
|
||||
|
||||
switch (flags & ios_base::floatfield) {
|
||||
case ios_base::fixed:
|
||||
bp = _Stl_qfcvtR(x, (min) (precision, MAXFCVT), &decpt, &sign, cvtbuf);
|
||||
break;
|
||||
case ios_base::scientific :
|
||||
bp = _Stl_qecvtR(x, (min) (precision + 1, MAXECVT), &decpt, &sign, cvtbuf);
|
||||
break;
|
||||
default :
|
||||
bp = _Stl_qecvtR(x, (min) (precision, MAXECVT), &decpt, &sign, cvtbuf);
|
||||
break;
|
||||
}
|
||||
__format_float(buf, bp, decpt, sign, x, flags, precision, true);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
wchar_t* _STLP_CALL
|
||||
__convert_float_buffer(const char* first, const char* last, wchar_t* out,
|
||||
const ctype<wchar_t>& ct, wchar_t dot)
|
||||
{
|
||||
ct.widen(first, last, out);
|
||||
if (ct.widen('.') != dot)
|
||||
replace(out, out + (last - first), ct.widen('.'), dot);
|
||||
return out + (last - first);
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
void _STLP_CALL
|
||||
__adjust_float_buffer(char* first, char* last, char dot)
|
||||
{
|
||||
if ('.' != dot)
|
||||
replace(first, last, '.', dot);
|
||||
}
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
73
STLPORT/src/numpunct.cpp
Normal file
73
STLPORT/src/numpunct.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
# include <stl/_numpunct.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// numpunct<char>
|
||||
char numpunct<char>::do_decimal_point() const {return '.';}
|
||||
char numpunct<char>::do_thousands_sep() const { return ','; }
|
||||
string numpunct<char>::do_grouping() const { return string();}
|
||||
string numpunct<char>::do_truename() const { return _M_truename;}
|
||||
string numpunct<char>::do_falsename() const { return _M_falsename; }
|
||||
numpunct<char>::~numpunct() {}
|
||||
|
||||
_STLP_STATIC_MEMBER_DECLSPEC string numpunct<char>::_M_truename("true");
|
||||
_STLP_STATIC_MEMBER_DECLSPEC string numpunct<char>::_M_falsename("false");
|
||||
_STLP_STATIC_MEMBER_DECLSPEC string numpunct<char>::_M_grouping("");
|
||||
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
numpunct<wchar_t>::~numpunct() {}
|
||||
|
||||
wchar_t numpunct<wchar_t>::do_decimal_point() const { return L'.'; }
|
||||
|
||||
wchar_t numpunct<wchar_t>::do_thousands_sep() const
|
||||
{
|
||||
return L',';
|
||||
}
|
||||
|
||||
string numpunct<wchar_t>::do_grouping() const
|
||||
{
|
||||
return string();
|
||||
}
|
||||
|
||||
|
||||
wstring numpunct<wchar_t>::do_truename() const
|
||||
{
|
||||
return _M_truename;
|
||||
}
|
||||
|
||||
wstring numpunct<wchar_t>::do_falsename() const
|
||||
{
|
||||
return _M_falsename;
|
||||
}
|
||||
|
||||
_STLP_STATIC_MEMBER_DECLSPEC wstring numpunct<wchar_t>::_M_truename(L"true");
|
||||
_STLP_STATIC_MEMBER_DECLSPEC wstring numpunct<wchar_t>::_M_falsename(L"false");
|
||||
_STLP_STATIC_MEMBER_DECLSPEC string numpunct<wchar_t>::_M_grouping("");
|
||||
# endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
57
STLPORT/src/ostream.cpp
Normal file
57
STLPORT/src/ostream.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
#include <stl/_ostream.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
#if !defined(_STLP_NO_FORCE_INSTANTIATE)
|
||||
|
||||
// instantiations
|
||||
template class _STLP_CLASS_DECLSPEC basic_ostream<char, char_traits<char> >;
|
||||
|
||||
template _STLP_DECLSPEC basic_ostream<char, char_traits<char> >& _STLP_CALL
|
||||
_M_put_num(basic_ostream<char, char_traits<char> >&, long);
|
||||
template _STLP_DECLSPEC basic_ostream<char, char_traits<char> >& _STLP_CALL
|
||||
_M_put_num(basic_ostream<char, char_traits<char> >&, unsigned long);
|
||||
# if defined (_STLP_LONG_LONG)
|
||||
template _STLP_DECLSPEC basic_ostream<char, char_traits<char> >& _STLP_CALL
|
||||
_M_put_num(basic_ostream<char, char_traits<char> >&, unsigned _STLP_LONG_LONG);
|
||||
template _STLP_DECLSPEC basic_ostream<char, char_traits<char> >& _STLP_CALL
|
||||
_M_put_num(basic_ostream<char, char_traits<char> >&, _STLP_LONG_LONG);
|
||||
# endif
|
||||
|
||||
# if defined (_STLP_USE_TEMPLATE_EXPORT)
|
||||
template class _STLP_CLASS_DECLSPEC _Osentry<char, char_traits<char> >;
|
||||
# endif
|
||||
|
||||
#ifndef _STLP_NO_WCHAR_T
|
||||
|
||||
# if defined (_STLP_USE_TEMPLATE_EXPORT)
|
||||
template class _STLP_CLASS_DECLSPEC _Osentry<wchar_t, char_traits<wchar_t> >;
|
||||
# endif
|
||||
template class _STLP_CLASS_DECLSPEC basic_ostream<wchar_t, char_traits<wchar_t> >;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
70
STLPORT/src/sgi_mipspro.mak
Normal file
70
STLPORT/src/sgi_mipspro.mak
Normal file
@@ -0,0 +1,70 @@
|
||||
#
|
||||
# Basename for libraries
|
||||
#
|
||||
.POSIX:
|
||||
|
||||
SHELL=/bin/sh
|
||||
|
||||
LIB_BASENAME = libstlport_mipspro
|
||||
|
||||
STL_INCL= -I. -I${PWD}/../stlport/
|
||||
CUR_DIR=./
|
||||
|
||||
CC = CC
|
||||
CXX = CC
|
||||
|
||||
#
|
||||
# guts for common stuff
|
||||
#
|
||||
#
|
||||
LINK=$(CC) -ar -all -o
|
||||
DYN_LINK=$(CC) -shared -all -o
|
||||
|
||||
OBJEXT=o
|
||||
DYNEXT=so
|
||||
STEXT=a
|
||||
RM=rm -rf
|
||||
PATH_SEP=/
|
||||
MKDIR=mkdir -p
|
||||
COMP=MIPS
|
||||
INSTALL_STEP = install_unix
|
||||
|
||||
all: msg all_dynamic all_static symbolic_links
|
||||
|
||||
msg:
|
||||
@echo "*** ATTENTION! ***"
|
||||
@echo "This makefile requires GNU make!"
|
||||
@echo "******************"
|
||||
|
||||
include common_macros.mak
|
||||
|
||||
CXXFLAGS_COMMON = -J 4 -ansi -LANG:std -I. -D_PTHREADS ${STL_INCL}
|
||||
|
||||
DEBUG_FLAGS = -g +w2 -D_STLP_DEBUG
|
||||
RELEASE_FLAGS = -O2
|
||||
|
||||
|
||||
# install: $(TARGETS)
|
||||
# cp -p $(TARGETS) ${INSTALLDIR}
|
||||
|
||||
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) ${RELEASE_FLAGS}
|
||||
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) ${RELEASE_FLAGS} $(SHCXXFLAGS)
|
||||
|
||||
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
|
||||
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g
|
||||
|
||||
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_COMMON) -O -g -D_STLP_DEBUG
|
||||
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -D_STLP_DEBUG
|
||||
|
||||
LDFLAGS_RELEASE_static = ${CXXFLAGS_RELEASE_static}
|
||||
LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic}
|
||||
|
||||
LDFLAGS_DEBUG_static = ${CXXFLAGS_DEBUG_static}
|
||||
LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic}
|
||||
|
||||
LDFLAGS_STLDEBUG_static = ${CXXFLAGS_STLDEBUG_static}
|
||||
LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic}
|
||||
|
||||
include common_percent_rules.mak
|
||||
include common_rules.mak
|
||||
|
||||
68
STLPORT/src/sparc_atomic.s
Normal file
68
STLPORT/src/sparc_atomic.s
Normal file
@@ -0,0 +1,68 @@
|
||||
.section ".text",#alloc,#execinstr
|
||||
.align 8
|
||||
.skip 16
|
||||
|
||||
|
||||
/*
|
||||
** int _STLP_atomic_exchange (void *pvalue, int value)
|
||||
*/
|
||||
|
||||
.type _STLP_atomic_exchange,#function
|
||||
.global _STLP_atomic_exchange
|
||||
.align 8
|
||||
|
||||
_STLP_atomic_exchange:
|
||||
0:
|
||||
ld [%o0], %o2 ! Set the current value
|
||||
mov %o1, %o3 ! Set the new value
|
||||
! swap [%o0], %o3 ! Do the compare and swap
|
||||
cas [%o0], %o2, %o3
|
||||
cmp %o2, %o3 ! Check whether successful
|
||||
bne 0b ! Retry upon failure
|
||||
stbar
|
||||
mov %o2, %o0 ! Set the new value
|
||||
retl ! return
|
||||
nop
|
||||
.size _STLP_atomic_exchange,(.-_STLP_atomic_exchange)
|
||||
|
||||
/* int _STLP_atomic_increment (void *pvalue) */
|
||||
|
||||
.type _STLP_atomic_increment,#function
|
||||
.global _STLP_atomic_increment
|
||||
.align 8
|
||||
_STLP_atomic_increment:
|
||||
1:
|
||||
ld [%o0], %o2 ! set the current
|
||||
add %o2, 0x1, %o3 ! Increment and store current
|
||||
! swap [%o0], %o3 ! Do the compare and swap
|
||||
cas [%o0], %o2, %o3
|
||||
cmp %o3, %o2 ! Check whether successful
|
||||
bne 1b ! Retry if we failed.
|
||||
membar #LoadLoad | #LoadStore ! Ensure the cas finishes before
|
||||
! returning
|
||||
nop
|
||||
retl ! return
|
||||
nop
|
||||
|
||||
.size _STLP_atomic_increment,(.-_STLP_atomic_increment)
|
||||
|
||||
|
||||
/* int _STLP_atomic_decrement (void *pvalue) */
|
||||
.type _STLP_atomic_decrement,#function
|
||||
.global _STLP_atomic_decrement
|
||||
.align 8
|
||||
|
||||
_STLP_atomic_decrement:
|
||||
2:
|
||||
ld [%o0], %o2 ! set the current
|
||||
sub %o2, 0x1, %o3 ! decrement and store current
|
||||
! swap [%o0], %o3 ! Do the compare and swap
|
||||
cas [%o0], %o2, %o3
|
||||
cmp %o3, %o2 ! Check whether successful
|
||||
bne 2b ! Retry if we failed.
|
||||
membar #LoadLoad | #LoadStore ! Ensure the cas finishes before
|
||||
nop
|
||||
! returning
|
||||
retl ! return
|
||||
nop
|
||||
.size _STLP_atomic_decrement,(.-_STLP_atomic_decrement)
|
||||
65
STLPORT/src/sparc_atomic64.s
Normal file
65
STLPORT/src/sparc_atomic64.s
Normal file
@@ -0,0 +1,65 @@
|
||||
.section ".text",#alloc,#execinstr
|
||||
.align 8
|
||||
.skip 16
|
||||
|
||||
! int _STLP_atomic_exchange (void *pvalue, int value)
|
||||
!
|
||||
|
||||
.type _STLP_atomic_exchange,#function
|
||||
.global _STLP_atomic_exchange
|
||||
.align 8
|
||||
|
||||
_STLP_atomic_exchange:
|
||||
1:
|
||||
ldx [%o0], %o2 ! Set the current value
|
||||
mov %o1, %o3 ! Set the new value
|
||||
casx [%o0], %o2, %o3 ! Do the compare and swap
|
||||
cmp %o2, %o3 ! Check whether successful
|
||||
bne 1b ! Retry upon failure
|
||||
membar #LoadLoad | #LoadStore ! Ensure the cas finishes before
|
||||
! returning
|
||||
retl ! return
|
||||
mov %o2, %o0 ! Set the new value
|
||||
.size _STLP_atomic_exchange,(.-_STLP_atomic_exchange)
|
||||
|
||||
|
||||
! int _STLP_atomic_increment (void *pvalue)
|
||||
|
||||
.type _STLP_atomic_increment,#function
|
||||
.global _STLP_atomic_increment
|
||||
.align 8
|
||||
_STLP_atomic_increment:
|
||||
0:
|
||||
ldx [%o0], %o2 ! set the current
|
||||
addx %o2, 0x1, %o3 ! Increment and store current
|
||||
casx [%o0], %o2, %o3 ! Do the compare and swap
|
||||
cmp %o3, %o2 ! Check whether successful
|
||||
bne 0b
|
||||
membar #LoadLoad | #LoadStore ! Ensure the cas finishes before
|
||||
! returning
|
||||
retl ! return
|
||||
mov %o1, %o0 ! Set the return value
|
||||
|
||||
.size _STLP_atomic_increment,(.-_STLP_atomic_increment)
|
||||
|
||||
|
||||
! /* int _STLP_atomic_decrement (void *pvalue) */
|
||||
.type _STLP_atomic_decrement,#function
|
||||
.global _STLP_atomic_decrement
|
||||
.align 8
|
||||
|
||||
_STLP_atomic_decrement:
|
||||
0:
|
||||
ldx [%o0], %o2 ! set the current
|
||||
subx %o2, 0x1, %o3 ! decrement and store current
|
||||
casx [%o0], %o2, %o3 ! Do the compare and swap
|
||||
cmp %o3, %o2 ! Check whether successful
|
||||
bne 0b
|
||||
membar #LoadLoad | #LoadStore ! Ensure the cas finishes before
|
||||
! returning
|
||||
retl ! return
|
||||
nop
|
||||
.size _STLP_atomic_decrement,(.-_STLP_atomic_decrement)
|
||||
|
||||
|
||||
|
||||
44
STLPORT/src/sstream.cpp
Normal file
44
STLPORT/src/sstream.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
#include <stl/_sstream.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
# ifndef _STLP_NO_FORCE_INSTANTIATE
|
||||
|
||||
// Force instantiation of stringstream classes.
|
||||
template class _STLP_CLASS_DECLSPEC basic_stringbuf<char, char_traits<char>, allocator<char> >;
|
||||
template class _STLP_CLASS_DECLSPEC basic_ostringstream<char, char_traits<char>, allocator<char> >;
|
||||
template class _STLP_CLASS_DECLSPEC basic_istringstream<char, char_traits<char>, allocator<char> >;
|
||||
template class _STLP_CLASS_DECLSPEC basic_stringstream<char, char_traits<char>, allocator<char> >;
|
||||
|
||||
#ifndef _STLP_NO_WCHAR_T
|
||||
template class _STLP_CLASS_DECLSPEC basic_stringbuf<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
|
||||
template class _STLP_CLASS_DECLSPEC basic_ostringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
|
||||
template class _STLP_CLASS_DECLSPEC basic_istringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
|
||||
template class _STLP_CLASS_DECLSPEC basic_stringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
|
||||
#endif /* INSTANTIATE_WIDE_STREAMS */
|
||||
|
||||
# endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
239
STLPORT/src/stdio_streambuf.cpp
Normal file
239
STLPORT/src/stdio_streambuf.cpp
Normal file
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
#include <stdio_streambuf>
|
||||
|
||||
#ifdef _STLP_UNIX
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#endif /* __unix */
|
||||
|
||||
#include <stl/_fstream.h>
|
||||
#include "fstream_impl.h"
|
||||
|
||||
# if defined (_STLP_USE_WIN32_IO) && !defined(_STLP_WINCE)
|
||||
# if defined (__BORLANDC__)
|
||||
// # include <cio.h>
|
||||
# include <cfcntl.h>
|
||||
# else
|
||||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
# endif
|
||||
|
||||
# include <sys/stat.h>
|
||||
# endif
|
||||
|
||||
__SGI_BEGIN_NAMESPACE
|
||||
//----------------------------------------------------------------------
|
||||
// Class stdio_streambuf_base
|
||||
|
||||
stdio_streambuf_base::stdio_streambuf_base(FILE* file)
|
||||
: _STLP_STD::basic_streambuf<char, _STLP_STD::char_traits<char> >(file, 0),
|
||||
_M_file(file)
|
||||
{}
|
||||
|
||||
stdio_streambuf_base::~stdio_streambuf_base()
|
||||
{
|
||||
_STLP_VENDOR_CSTD::fflush(_M_file);
|
||||
}
|
||||
|
||||
_STLP_STD::streambuf* stdio_streambuf_base::setbuf(char* s, streamsize n)
|
||||
{
|
||||
_STLP_VENDOR_CSTD::setvbuf(_M_file, s, (s == 0 && n == 0) ? _IONBF : _IOFBF, n);
|
||||
return this;
|
||||
}
|
||||
|
||||
stdio_streambuf_base::pos_type
|
||||
stdio_streambuf_base::seekoff(off_type off, ios_base::seekdir dir,
|
||||
ios_base::openmode /* mode */)
|
||||
{
|
||||
int whence;
|
||||
switch(dir) {
|
||||
case ios_base::beg:
|
||||
whence = SEEK_SET;
|
||||
break;
|
||||
case ios_base::cur:
|
||||
whence = SEEK_CUR;
|
||||
break;
|
||||
case ios_base::end:
|
||||
whence = SEEK_END;
|
||||
break;
|
||||
default:
|
||||
return pos_type(-1);
|
||||
}
|
||||
|
||||
if (_STLP_VENDOR_CSTD::fseek(_M_file, off, whence) == 0) {
|
||||
fpos_t pos;
|
||||
_STLP_VENDOR_CSTD::fgetpos(_M_file, &pos);
|
||||
// added 21 june 00 mdb,rjf,wjs: glibc 2.2 changed fpos_t to be a struct instead
|
||||
// of a primitive type
|
||||
#if (defined(__GLIBC__) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
|
||||
return pos_type((streamoff)pos.__pos);
|
||||
#elif defined(__ISCPP__) || defined(__MVS__) || (__OS400__)
|
||||
return pos_type(pos.__fpos_elem[ 0 ]);
|
||||
#elif defined (__EMX__)
|
||||
return pos_type((streamoff)pos._pos);
|
||||
#else
|
||||
return pos_type(pos);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
return pos_type(-1);
|
||||
}
|
||||
|
||||
|
||||
stdio_streambuf_base::pos_type
|
||||
stdio_streambuf_base::seekpos(pos_type pos, ios_base::openmode /* mode */) // dwa 4/27/00 - suppress unused parameter warning
|
||||
{
|
||||
|
||||
// added 21 june 00 mdb,rjf,wjs: glibc 2.2 changed fpos_t to be a struct instead
|
||||
// of a primitive type
|
||||
#if (defined(__GLIBC__) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
|
||||
fpos_t p;
|
||||
p.__pos = pos;
|
||||
memset( &(p.__state), 0, sizeof(p.__state) );
|
||||
#elif defined(__MVS__) || (__OS400__)
|
||||
fpos_t p;
|
||||
p.__fpos_elem[0] = pos;
|
||||
#elif defined(__EMX__)
|
||||
fpos_t p;
|
||||
p._pos = pos;
|
||||
memset( &(p._mbstate), 0, sizeof(p._mbstate) );
|
||||
#else
|
||||
fpos_t p(pos);
|
||||
#endif
|
||||
|
||||
if (_STLP_VENDOR_CSTD::fsetpos(_M_file, &p) == 0)
|
||||
return pos;
|
||||
else
|
||||
return pos_type(-1);
|
||||
}
|
||||
|
||||
int stdio_streambuf_base::sync()
|
||||
{
|
||||
return _STLP_VENDOR_CSTD::fflush(_M_file) == 0 ? 0 : -1;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Class stdio_istreambuf
|
||||
|
||||
stdio_istreambuf::~stdio_istreambuf() {}
|
||||
|
||||
streamsize stdio_istreambuf::showmanyc()
|
||||
{
|
||||
if (feof(_M_file))
|
||||
return -1;
|
||||
else {
|
||||
int fd = _FILE_fd(_M_file);
|
||||
# ifdef _STLP_USE_WIN32_IO
|
||||
// in this case, __file_size works with Win32 fh , not libc one
|
||||
streamoff size;
|
||||
struct stat buf;
|
||||
# ifdef __BORLANDC__
|
||||
if(fstat(fd, &buf) == 0 && S_ISREG( buf.st_mode ) )
|
||||
# else
|
||||
if(fstat(fd, &buf) == 0 && ( _S_IFREG & buf.st_mode ) )
|
||||
# endif
|
||||
size = ( buf.st_size > 0 ? buf.st_size : 0);
|
||||
else
|
||||
size = 0;
|
||||
# else
|
||||
streamoff size = _SgI::__file_size(fd);
|
||||
# endif
|
||||
// fbp : we can use ftell as this flavour always use stdio.
|
||||
long pos = _STLP_VENDOR_CSTD::ftell(_M_file);
|
||||
return pos >= 0 && size > pos ? size - pos : 0;
|
||||
}
|
||||
}
|
||||
|
||||
stdio_istreambuf::int_type stdio_istreambuf::underflow()
|
||||
{
|
||||
int c = getc(_M_file);
|
||||
if (c != EOF) {
|
||||
_STLP_VENDOR_CSTD::ungetc(c, _M_file);
|
||||
return c;
|
||||
}
|
||||
else
|
||||
return traits_type::eof();
|
||||
}
|
||||
|
||||
stdio_istreambuf::int_type stdio_istreambuf::uflow()
|
||||
{
|
||||
int c = getc(_M_file);
|
||||
return c != EOF ? c : traits_type::eof();
|
||||
}
|
||||
|
||||
stdio_istreambuf::int_type stdio_istreambuf::pbackfail(int_type c)
|
||||
{
|
||||
if (c != traits_type::eof()) {
|
||||
int result = _STLP_VENDOR_CSTD::ungetc(c, _M_file);
|
||||
return result != EOF ? result : traits_type::eof();
|
||||
}
|
||||
else{
|
||||
if (this->eback() < this->gptr()) {
|
||||
this->gbump(-1);
|
||||
return traits_type::not_eof(c);
|
||||
}
|
||||
else
|
||||
return traits_type::eof();
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Class stdio_ostreambuf
|
||||
|
||||
stdio_ostreambuf::~stdio_ostreambuf() {}
|
||||
|
||||
streamsize stdio_ostreambuf::showmanyc()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
stdio_ostreambuf::int_type stdio_ostreambuf::overflow(int_type c)
|
||||
{
|
||||
// Write the existing buffer, without writing any additional character.
|
||||
if (c == traits_type::eof()) {
|
||||
// Do we have a buffer to write?
|
||||
ptrdiff_t unwritten = this->pptr() - this->pbase();
|
||||
if (unwritten != 0) {
|
||||
_STLP_VENDOR_CSTD::fflush(_M_file);
|
||||
// Test if the write succeeded.
|
||||
if (this->pptr() - this->pbase() < unwritten)
|
||||
return traits_type::not_eof(c);
|
||||
else
|
||||
return traits_type::eof();
|
||||
}
|
||||
|
||||
// We always succeed if we don't have to do anything.
|
||||
else
|
||||
return traits_type::not_eof(c);
|
||||
}
|
||||
|
||||
// Write the character c, and whatever else might be in the buffer.
|
||||
else {
|
||||
int result = putc(c, _M_file);
|
||||
return result != EOF ? result : traits_type::eof();
|
||||
}
|
||||
}
|
||||
|
||||
__SGI_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
56
STLPORT/src/stlport.rc
Normal file
56
STLPORT/src/stlport.rc
Normal file
@@ -0,0 +1,56 @@
|
||||
///////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define VER_MAJOR 4
|
||||
#define VER_MINOR 6
|
||||
#define VER_YEAR 2003
|
||||
#define VER_MMDD 1031
|
||||
|
||||
#define VERSION_STRING2(x) #x "\0"
|
||||
#define VERSION_STRING(x) VERSION_STRING2(x)
|
||||
#define VERSION_ID VER_MAJOR, VER_MINOR, VER_YEAR, VER_MMDD
|
||||
#define VERSION_STR VERSION_STRING(VER_MAJOR.VER_MINOR.VER_YEAR.VER_MMDD)
|
||||
|
||||
#define VERSION_STRING1(x) #x
|
||||
#define DLLNAME_STRING2(compstr,buildstr) \
|
||||
"STLPORT_" VERSION_STRING1(compstr) VERSION_STRING1(buildstr) "_\0" VERSION_STRING1(VER_MAJOR) VERSION_STRING1(VER_MINOR) ".DLL\0"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VERSION_ID
|
||||
PRODUCTVERSION VERSION_ID
|
||||
FILEFLAGSMASK 0x3fL
|
||||
|
||||
// FILEFLAGS VS_FF_DEBUG
|
||||
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "STLport Consulting, Inc.\0"
|
||||
VALUE "FileDescription", "STLport\0"
|
||||
VALUE "FileVersion", VERSION_STR
|
||||
VALUE "InternalName", "STLPORT.DLL\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) Boris Fomitchev\0"
|
||||
|
||||
VALUE "OriginalFilename", DLLNAME_STRING2(COMP,BUILD)
|
||||
|
||||
VALUE "ProductName", "STLport Standard ANSI C++ Library\0"
|
||||
VALUE "ProductVersion", VERSION_STR
|
||||
#ifdef BUILD
|
||||
VALUE "SpecialBuild", VERSION_STRING2(BUILD)
|
||||
#endif
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
42
STLPORT/src/stlport_prefix.h
Normal file
42
STLPORT/src/stlport_prefix.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef STLPORT_PREFIX_H
|
||||
# define STLPORT_PREFIX_H
|
||||
|
||||
# define __BUILDING_STLPORT 1
|
||||
|
||||
# if defined (_WIN32) || defined (WIN32)
|
||||
# ifdef __cplusplus
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# define NOSERVICE
|
||||
# endif
|
||||
# if !(defined (__CYGWIN__) || defined(_WIN32_WCE))
|
||||
# define _STLP_REAL_LOCALE_IMPLEMENTED
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# undef _STLP_NO_FORCE_INSTANTIATE
|
||||
|
||||
/* Please add extra compilation switches for particular compilers here */
|
||||
|
||||
# include <stl/_config.h>
|
||||
|
||||
# if defined (_STLP_USE_TEMPLATE_EXPORT) && defined (_STLP_USE_DECLSPEC) && ! defined (_STLP_EXPOSE_GLOBALS_IMPLEMENTATION)
|
||||
# define _STLP_EXPOSE_GLOBALS_IMPLEMENTATION
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
|
||||
# include <ctime>
|
||||
# if defined (_STLP_USE_NAMESPACES) && ! defined (_STLP_VENDOR_GLOBAL_CSTD)
|
||||
using _STLP_VENDOR_CSTD::time_t;
|
||||
# endif
|
||||
|
||||
# if defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER) || defined (__BORLANDC__)
|
||||
# define _STLP_OPERATOR_SPEC _STLP_DECLSPEC
|
||||
# else
|
||||
# define _STLP_OPERATOR_SPEC _STLP_TEMPLATE_NULL _STLP_DECLSPEC
|
||||
# endif
|
||||
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* PREFIX */
|
||||
|
||||
242
STLPORT/src/streambuf.cpp
Normal file
242
STLPORT/src/streambuf.cpp
Normal file
@@ -0,0 +1,242 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
# include "stlport_prefix.h"
|
||||
|
||||
|
||||
#include <stl/_streambuf.h>
|
||||
#include <stl/_algobase.h>
|
||||
|
||||
// Implementation of non-inline member functions of class
|
||||
// basic_streambuf<char, char_traits<char> >
|
||||
|
||||
# if defined (__hpux)
|
||||
# define FILE_CAST(x) (__REINTERPRET_CAST(FILE*, x))
|
||||
# else
|
||||
# define FILE_CAST(x) x
|
||||
# endif
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
#if !defined(_STLP_WINCE)
|
||||
|
||||
basic_streambuf<char, char_traits<char> >::~basic_streambuf() {}
|
||||
|
||||
// This constructor is an extension. It is for streambuf subclasses that
|
||||
// are synchronized with C stdio files.
|
||||
basic_streambuf<char, char_traits<char> >
|
||||
::basic_streambuf(FILE* __get, FILE* __put)
|
||||
: _M_get(__get ? __get : FILE_CAST(&_M_default_get)),
|
||||
_M_put(__put ? __put : FILE_CAST(&_M_default_put)),
|
||||
_M_locale()
|
||||
{
|
||||
_M_lock._M_initialize();
|
||||
|
||||
if (_M_get == FILE_CAST(&_M_default_get))
|
||||
_FILE_I_set(_M_get, 0, 0, 0);
|
||||
if (_M_put == FILE_CAST(&_M_default_put))
|
||||
_FILE_O_set(_M_put, 0, 0, 0);
|
||||
}
|
||||
|
||||
// virtual functions
|
||||
|
||||
void basic_streambuf<char, char_traits<char> >::imbue(const locale&)
|
||||
{}
|
||||
|
||||
basic_streambuf<char, char_traits<char> >*
|
||||
basic_streambuf<char, char_traits<char> >::setbuf(char*, streamsize)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
basic_streambuf<char, char_traits<char> >::pos_type
|
||||
basic_streambuf<char, char_traits<char> >
|
||||
::seekoff(off_type, ios_base::seekdir, ios_base::openmode)
|
||||
{
|
||||
return pos_type(-1);
|
||||
}
|
||||
|
||||
basic_streambuf<char, char_traits<char> >::pos_type
|
||||
basic_streambuf<char, char_traits<char> >
|
||||
::seekpos(pos_type, ios_base::openmode)
|
||||
{
|
||||
return pos_type(-1);
|
||||
}
|
||||
|
||||
int basic_streambuf<char, char_traits<char> >::sync()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
streamsize basic_streambuf<char, char_traits<char> >::showmanyc()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
streamsize basic_streambuf<char, char_traits<char> >
|
||||
::xsgetn(char* s, streamsize n)
|
||||
{
|
||||
streamsize result = 0;
|
||||
const int_type eof = traits_type::eof();
|
||||
|
||||
while (result < n) {
|
||||
if (_FILE_I_avail(_M_get) > 0) {
|
||||
size_t chunk = (min) (__STATIC_CAST(size_t,_FILE_I_avail(_M_get)),
|
||||
__STATIC_CAST(size_t,n - result));
|
||||
traits_type::copy(s, _FILE_I_next(_M_get), chunk);
|
||||
result += chunk;
|
||||
s += chunk;
|
||||
_FILE_I_bump(_M_get, chunk);
|
||||
}
|
||||
else {
|
||||
int_type c = sbumpc();
|
||||
if (c != eof) {
|
||||
*s = c;
|
||||
++result;
|
||||
++s;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
basic_streambuf<char, char_traits<char> >::int_type
|
||||
basic_streambuf<char, char_traits<char> >::underflow()
|
||||
{
|
||||
return traits_type::eof();
|
||||
}
|
||||
|
||||
basic_streambuf<char, char_traits<char> >::int_type
|
||||
basic_streambuf<char, char_traits<char> >::uflow()
|
||||
{
|
||||
const int_type eof = traits_type::eof();
|
||||
return this->underflow() == eof
|
||||
? eof
|
||||
: traits_type::to_int_type(_FILE_I_postincr(_M_get));
|
||||
}
|
||||
|
||||
basic_streambuf<char, char_traits<char> >::int_type
|
||||
basic_streambuf<char, char_traits<char> >::pbackfail(int_type /* __c */)
|
||||
{
|
||||
return traits_type::eof();
|
||||
}
|
||||
|
||||
|
||||
streamsize basic_streambuf<char, char_traits<char> >
|
||||
::xsputn(const char* s, streamsize n)
|
||||
{
|
||||
streamsize result = 0;
|
||||
const int_type eof = traits_type::eof();
|
||||
|
||||
while (result < n) {
|
||||
if (_FILE_O_avail(_M_put) > 0) {
|
||||
size_t chunk = (min) (__STATIC_CAST(size_t,_FILE_O_avail(_M_put)),
|
||||
__STATIC_CAST(size_t,n - result));
|
||||
traits_type::copy(_FILE_O_next(_M_put), s, chunk);
|
||||
result += chunk;
|
||||
s += chunk;
|
||||
_FILE_O_bump(_M_put, (int)chunk);
|
||||
}
|
||||
|
||||
else if (this->overflow(traits_type::to_int_type(*s)) != eof) {
|
||||
++result;
|
||||
++s;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
streamsize basic_streambuf<char, char_traits<char> >
|
||||
::_M_xsputnc(char c, streamsize n)
|
||||
{
|
||||
streamsize result = 0;
|
||||
const int_type eof = traits_type::eof();
|
||||
|
||||
while (result < n) {
|
||||
if (_FILE_O_avail(_M_put) > 0) {
|
||||
size_t chunk = (min) (__STATIC_CAST(size_t,_FILE_O_avail(_M_put)),
|
||||
__STATIC_CAST(size_t,n - result));
|
||||
traits_type::assign(_FILE_O_next(_M_put), chunk, c);
|
||||
result += chunk;
|
||||
_FILE_O_bump(_M_put, (int)chunk);
|
||||
}
|
||||
|
||||
else if (this->overflow(traits_type::to_int_type(c)) != eof)
|
||||
++result;
|
||||
else
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
basic_streambuf<char, char_traits<char> >::int_type
|
||||
basic_streambuf<char, char_traits<char> >::overflow(int_type/* c */)
|
||||
{
|
||||
return traits_type::eof();
|
||||
}
|
||||
|
||||
basic_streambuf<char, char_traits<char> >::int_type
|
||||
basic_streambuf<char, char_traits<char> >::_M_snextc_aux()
|
||||
{
|
||||
int_type eof = traits_type::eof();
|
||||
if (_FILE_I_avail(_M_get) == 0)
|
||||
return this->uflow() == eof ? eof : this->sgetc();
|
||||
else {
|
||||
_FILE_I_set(_M_get,
|
||||
_FILE_I_begin(_M_get), _FILE_I_end(_M_get), _FILE_I_end(_M_get));
|
||||
return this->underflow();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
locale basic_streambuf<char, char_traits<char> >::pubimbue(const locale& loc)
|
||||
{
|
||||
this->imbue(loc);
|
||||
locale tmp = _M_locale;
|
||||
_M_locale = loc;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if !defined(_STLP_NO_FORCE_INSTANTIATE)
|
||||
template class basic_streambuf<char, char_traits<char> >;
|
||||
#endif
|
||||
|
||||
#endif /* _STLP_WINCE */
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Force instantiation of basic_streambuf
|
||||
|
||||
// not basic_streambuf<char>, because it's specialized.
|
||||
|
||||
#if !defined(_STLP_NO_FORCE_INSTANTIATE)
|
||||
#if !defined (_STLP_NO_WCHAR_T)
|
||||
template class basic_streambuf<wchar_t, char_traits<wchar_t> >;
|
||||
#endif /* INSTANTIATE_WIDE_STREAMS */
|
||||
#endif
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
16
STLPORT/src/string_w.cpp
Normal file
16
STLPORT/src/string_w.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "stlport_prefix.h"
|
||||
#include <stl/_string.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
# ifndef _STLP_NO_FORCE_INSTANTIATE
|
||||
# ifndef _STLP_NO_WCHAR_T
|
||||
template class _STLP_CLASS_DECLSPEC allocator<wchar_t>;
|
||||
template class _STLP_CLASS_DECLSPEC _String_base<wchar_t, allocator<wchar_t> >;
|
||||
# ifdef _STLP_DEBUG
|
||||
template class _STLP_CLASS_DECLSPEC _Nondebug_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
|
||||
# endif
|
||||
template class _STLP_CLASS_DECLSPEC basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
|
||||
# endif
|
||||
# endif
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
425
STLPORT/src/strstream.cpp
Normal file
425
STLPORT/src/strstream.cpp
Normal file
@@ -0,0 +1,425 @@
|
||||
/*
|
||||
* Copyright (c) 1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Copyright (c) 1999
|
||||
* Boris Fomitchev
|
||||
*
|
||||
* This material is provided "as is", with absolutely no warranty expressed
|
||||
* or implied. Any use is at your own risk.
|
||||
*
|
||||
* Permission to use or copy this software for any purpose is hereby granted
|
||||
* without fee, provided the above notices are retained on all copies.
|
||||
* Permission to modify the code and to distribute modified code is granted,
|
||||
* provided the above notices are retained, and a notice that the code was
|
||||
* modified is included with the above copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
// Implementation of the classes in header <strstream>.
|
||||
// WARNING: The classes defined in <strstream> are DEPRECATED. This
|
||||
// header is defined in section D.7.1 of the C++ standard, and it
|
||||
// MAY BE REMOVED in a future standard revision. You should use the
|
||||
// header <sstream> instead.
|
||||
|
||||
# include "stlport_prefix.h"
|
||||
#include <stl/_strstream.h>
|
||||
#include <stl/_algobase.h>
|
||||
|
||||
_STLP_BEGIN_NAMESPACE
|
||||
|
||||
// strstreambuf constructor, destructor.
|
||||
|
||||
strstreambuf::strstreambuf(streamsize initial_capacity)
|
||||
: _M_alloc_fun(0), _M_free_fun(0),
|
||||
_M_dynamic(true), _M_frozen(false), _M_constant(false)
|
||||
{
|
||||
streamsize n = (max)(initial_capacity, streamsize(16));
|
||||
|
||||
char* buf = _M_alloc(n);
|
||||
if (buf) {
|
||||
setp(buf, buf + n);
|
||||
setg(buf, buf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
strstreambuf::strstreambuf(__alloc_fn alloc_f, __free_fn free_f)
|
||||
: _M_alloc_fun(alloc_f), _M_free_fun(free_f),
|
||||
_M_dynamic(true), _M_frozen(false), _M_constant(false)
|
||||
{
|
||||
streamsize n = 16;
|
||||
|
||||
char* buf = _M_alloc(n);
|
||||
if (buf) {
|
||||
setp(buf, buf + n);
|
||||
setg(buf, buf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
strstreambuf::strstreambuf(char* get, streamsize n, char* put)
|
||||
: _M_alloc_fun(0), _M_free_fun(0),
|
||||
_M_dynamic(false), _M_frozen(false), _M_constant(false)
|
||||
{
|
||||
_M_setup(get, put, n);
|
||||
}
|
||||
|
||||
strstreambuf::strstreambuf(signed char* get, streamsize n, signed char* put)
|
||||
: _M_alloc_fun(0), _M_free_fun(0),
|
||||
_M_dynamic(false), _M_frozen(false), _M_constant(false)
|
||||
{
|
||||
_M_setup(__REINTERPRET_CAST(char*,get), __REINTERPRET_CAST(char*,put), n);
|
||||
}
|
||||
|
||||
strstreambuf::strstreambuf(unsigned char* get, streamsize n,
|
||||
unsigned char* put)
|
||||
: _M_alloc_fun(0), _M_free_fun(0),
|
||||
_M_dynamic(false), _M_frozen(false), _M_constant(false)
|
||||
{
|
||||
_M_setup(__REINTERPRET_CAST(char*,get), __REINTERPRET_CAST(char*,put), n);
|
||||
}
|
||||
|
||||
strstreambuf::strstreambuf(const char* get, streamsize n)
|
||||
: _M_alloc_fun(0), _M_free_fun(0),
|
||||
_M_dynamic(false), _M_frozen(false), _M_constant(true)
|
||||
{
|
||||
_M_setup(__CONST_CAST(char*,get), 0, n);
|
||||
}
|
||||
|
||||
strstreambuf::strstreambuf(const signed char* get, streamsize n)
|
||||
: _M_alloc_fun(0), _M_free_fun(0),
|
||||
_M_dynamic(false), _M_frozen(false), _M_constant(true)
|
||||
{
|
||||
_M_setup(__REINTERPRET_CAST(char*, __CONST_CAST(signed char*,get)), 0, n);
|
||||
}
|
||||
|
||||
strstreambuf::strstreambuf(const unsigned char* get, streamsize n)
|
||||
: _M_alloc_fun(0), _M_free_fun(0),
|
||||
_M_dynamic(false), _M_frozen(false), _M_constant(true)
|
||||
{
|
||||
_M_setup(__REINTERPRET_CAST(char*, __CONST_CAST(unsigned char*,get)), 0, n);
|
||||
}
|
||||
|
||||
strstreambuf::~strstreambuf()
|
||||
{
|
||||
if (_M_dynamic && !_M_frozen)
|
||||
_M_free(eback());
|
||||
}
|
||||
|
||||
void strstreambuf::freeze(bool frozenflag)
|
||||
{
|
||||
if (_M_dynamic)
|
||||
_M_frozen = frozenflag;
|
||||
}
|
||||
|
||||
char* strstreambuf::str()
|
||||
{
|
||||
freeze(true);
|
||||
return eback();
|
||||
}
|
||||
|
||||
int strstreambuf::pcount() const
|
||||
{
|
||||
return int(pptr() ? pptr() - pbase() : 0);
|
||||
}
|
||||
|
||||
strstreambuf::int_type strstreambuf::overflow(int_type c) {
|
||||
if (c == traits_type::eof())
|
||||
return traits_type::not_eof(c);
|
||||
|
||||
// Try to expand the buffer.
|
||||
if (pptr() == epptr() && _M_dynamic && !_M_frozen && !_M_constant) {
|
||||
ptrdiff_t old_size = epptr() - pbase();
|
||||
ptrdiff_t new_size = (max)(2 * old_size, ptrdiff_t(1));
|
||||
|
||||
char* buf = _M_alloc(new_size);
|
||||
if (buf) {
|
||||
memcpy(buf, pbase(), old_size);
|
||||
|
||||
char* old_buffer = pbase();
|
||||
bool reposition_get = false;
|
||||
ptrdiff_t old_get_offset;
|
||||
if (gptr() != 0) {
|
||||
reposition_get = true;
|
||||
old_get_offset = gptr() - eback();
|
||||
}
|
||||
|
||||
setp(buf, buf + new_size);
|
||||
pbump((int)old_size);
|
||||
|
||||
if (reposition_get)
|
||||
setg(buf, buf + old_get_offset, buf + (max)(old_get_offset, old_size));
|
||||
|
||||
_M_free(old_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if (pptr() != epptr()) {
|
||||
*pptr() = c;
|
||||
pbump(1);
|
||||
return c;
|
||||
}
|
||||
else
|
||||
return traits_type::eof();
|
||||
}
|
||||
|
||||
strstreambuf::int_type strstreambuf::pbackfail(int_type c)
|
||||
{
|
||||
if (gptr() != eback()) {
|
||||
if (c == _Traits::eof()) {
|
||||
gbump(-1);
|
||||
return _Traits::not_eof(c);
|
||||
}
|
||||
else if (c == gptr()[-1]) {
|
||||
gbump(-1);
|
||||
return c;
|
||||
}
|
||||
else if (!_M_constant) {
|
||||
gbump(-1);
|
||||
*gptr() = c;
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
return _Traits::eof();
|
||||
}
|
||||
|
||||
strstreambuf::int_type strstreambuf::underflow()
|
||||
{
|
||||
if (gptr() == egptr() && pptr() && pptr() > egptr())
|
||||
setg(eback(), gptr(), pptr());
|
||||
|
||||
if (gptr() != egptr())
|
||||
return (unsigned char) *gptr();
|
||||
else
|
||||
return _Traits::eof();
|
||||
}
|
||||
|
||||
basic_streambuf<char, char_traits<char> >*
|
||||
strstreambuf::setbuf(char*, streamsize)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
strstreambuf::pos_type
|
||||
strstreambuf::seekoff(off_type off,
|
||||
ios_base::seekdir dir, ios_base::openmode mode)
|
||||
{
|
||||
bool do_get = false;
|
||||
bool do_put = false;
|
||||
|
||||
if ((mode & (ios_base::in | ios_base::out)) ==
|
||||
(ios_base::in | ios_base::out) &&
|
||||
(dir == ios_base::beg || dir == ios_base::end))
|
||||
do_get = do_put = true;
|
||||
else if (mode & ios_base::in)
|
||||
do_get = true;
|
||||
else if (mode & ios_base::out)
|
||||
do_put = true;
|
||||
|
||||
// !gptr() is here because, according to D.7.1 paragraph 4, the seekable
|
||||
// area is undefined if there is no get area.
|
||||
if ((!do_get && !do_put) || (do_put && !pptr()) || !gptr())
|
||||
return pos_type(off_type(-1));
|
||||
|
||||
char* seeklow = eback();
|
||||
char* seekhigh = epptr() ? epptr() : egptr();
|
||||
|
||||
off_type newoff;
|
||||
switch(dir) {
|
||||
case ios_base::beg:
|
||||
newoff = 0;
|
||||
break;
|
||||
case ios_base::end:
|
||||
newoff = seekhigh - seeklow;
|
||||
break;
|
||||
case ios_base::cur:
|
||||
newoff = do_put ? pptr() - seeklow : gptr() - seeklow;
|
||||
break;
|
||||
default:
|
||||
return pos_type(off_type(-1));
|
||||
}
|
||||
|
||||
off += newoff;
|
||||
if (off < 0 || off > seekhigh - seeklow)
|
||||
return pos_type(off_type(-1));
|
||||
|
||||
if (do_put) {
|
||||
if (seeklow + off < pbase()) {
|
||||
setp(seeklow, epptr());
|
||||
pbump((int)off);
|
||||
}
|
||||
else {
|
||||
setp(pbase(), epptr());
|
||||
pbump((int)(off - (pbase() - seeklow)));
|
||||
}
|
||||
}
|
||||
if (do_get) {
|
||||
if (off <= egptr() - seeklow)
|
||||
setg(seeklow, seeklow + off, egptr());
|
||||
else if (off <= pptr() - seeklow)
|
||||
setg(seeklow, seeklow + off, pptr());
|
||||
else
|
||||
setg(seeklow, seeklow + off, epptr());
|
||||
}
|
||||
|
||||
return pos_type(newoff);
|
||||
}
|
||||
|
||||
strstreambuf::pos_type
|
||||
strstreambuf::seekpos(pos_type pos, ios_base::openmode mode)
|
||||
{
|
||||
return seekoff(pos - pos_type(off_type(0)), ios_base::beg, mode);
|
||||
}
|
||||
|
||||
|
||||
char* strstreambuf::_M_alloc(size_t n)
|
||||
{
|
||||
if (_M_alloc_fun)
|
||||
return __STATIC_CAST(char*,_M_alloc_fun(n));
|
||||
else
|
||||
return new char[n];
|
||||
}
|
||||
|
||||
void strstreambuf::_M_free(char* p)
|
||||
{
|
||||
if (p)
|
||||
if (_M_free_fun)
|
||||
_M_free_fun(p);
|
||||
else
|
||||
delete[] p;
|
||||
}
|
||||
|
||||
void strstreambuf::_M_setup(char* get, char* put, streamsize n)
|
||||
{
|
||||
if (get) {
|
||||
size_t N = n > 0 ? size_t(n) : n == 0 ? strlen(get) : size_t(INT_MAX);
|
||||
|
||||
if (put) {
|
||||
setg(get, get, put);
|
||||
setp(put, put + N);
|
||||
}
|
||||
else {
|
||||
setg(get, get, get + N);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Class istrstream
|
||||
|
||||
istrstream::istrstream(char* s)
|
||||
: basic_istream<char, char_traits<char> >(0), _M_buf(s, 0)
|
||||
{
|
||||
this->init(&_M_buf);
|
||||
}
|
||||
|
||||
istrstream::istrstream(const char* s)
|
||||
: basic_istream<char, char_traits<char> >(0), _M_buf(s, 0)
|
||||
{
|
||||
this->init(&_M_buf);
|
||||
}
|
||||
|
||||
istrstream::istrstream(char* s, streamsize n)
|
||||
: basic_istream<char, char_traits<char> >(0), _M_buf(s, n)
|
||||
{
|
||||
this->init(&_M_buf);
|
||||
}
|
||||
|
||||
istrstream::istrstream(const char* s, streamsize n)
|
||||
: basic_istream<char, char_traits<char> >(0), _M_buf(s, n)
|
||||
{
|
||||
this->init(&_M_buf);
|
||||
}
|
||||
|
||||
istrstream::~istrstream() {}
|
||||
|
||||
strstreambuf* istrstream::rdbuf() const {
|
||||
return __CONST_CAST(strstreambuf*,&_M_buf);
|
||||
}
|
||||
|
||||
char* istrstream::str() { return _M_buf.str(); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Class ostrstream
|
||||
|
||||
ostrstream::ostrstream()
|
||||
: basic_ostream<char, char_traits<char> >(0), _M_buf()
|
||||
{
|
||||
basic_ios<char, char_traits<char> >::init(&_M_buf);
|
||||
}
|
||||
|
||||
ostrstream::ostrstream(char* s, int n, ios_base::openmode mode)
|
||||
: basic_ostream<char, char_traits<char> >(0),
|
||||
_M_buf(s, n, mode & ios_base::app ? s + strlen(s) : s)
|
||||
{
|
||||
basic_ios<char, char_traits<char> >::init(&_M_buf);
|
||||
}
|
||||
|
||||
ostrstream::~ostrstream() {}
|
||||
|
||||
strstreambuf* ostrstream::rdbuf() const
|
||||
{
|
||||
return __CONST_CAST(strstreambuf*,&_M_buf);
|
||||
}
|
||||
|
||||
void ostrstream::freeze(bool freezeflag)
|
||||
{
|
||||
_M_buf.freeze(freezeflag);
|
||||
}
|
||||
|
||||
char* ostrstream::str()
|
||||
{
|
||||
return _M_buf.str();
|
||||
}
|
||||
|
||||
int ostrstream::pcount() const
|
||||
{
|
||||
return _M_buf.pcount();
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Class strstream
|
||||
|
||||
strstream::strstream()
|
||||
: basic_iostream<char, char_traits<char> >(0), _M_buf()
|
||||
{
|
||||
basic_ios<char, char_traits<char> >::init(&_M_buf);
|
||||
}
|
||||
|
||||
strstream::strstream(char* s, int n, ios_base::openmode mode)
|
||||
: basic_iostream<char, char_traits<char> >(0),
|
||||
_M_buf(s, n, mode & ios_base::app ? s + strlen(s) : s)
|
||||
{
|
||||
basic_ios<char, char_traits<char> >::init(&_M_buf);
|
||||
}
|
||||
|
||||
strstream::~strstream() {}
|
||||
|
||||
strstreambuf* strstream::rdbuf() const
|
||||
{
|
||||
return __CONST_CAST(strstreambuf*,&_M_buf);
|
||||
}
|
||||
|
||||
void strstream::freeze(bool freezeflag)
|
||||
{
|
||||
_M_buf.freeze(freezeflag);
|
||||
}
|
||||
|
||||
int strstream::pcount() const
|
||||
{
|
||||
return _M_buf.pcount();
|
||||
}
|
||||
|
||||
char* strstream::str()
|
||||
{
|
||||
return _M_buf.str();
|
||||
}
|
||||
|
||||
_STLP_END_NAMESPACE
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user