diff options
Diffstat (limited to 'cpp')
35 files changed, 1387 insertions, 120 deletions
diff --git a/cpp/INSTALL.WINDOWS b/cpp/INSTALL.WINDOWS index 89bc770d8cf..1d92aa31ac3 100644 --- a/cpp/INSTALL.WINDOWS +++ b/cpp/INSTALL.WINDOWS @@ -40,7 +40,7 @@ The following C++ compilers are supported: - Microsoft Visual C++ .NET 2003 SP1 (aka VC++ 7.1) -- Microsoft Visual C++ 6.0 SP5 with STLport 4.5 (or later) +- Microsoft Visual C++ 6.0 SP5 with STLport 4.6.2 (or later) The Standard Template Library included with Visual C++ 6.0 is not supported. STLPort is included in the Ice third-party package @@ -97,7 +97,7 @@ Third-party libraries Ice has dependencies on a number of third-party libraries: -- STLport 4.5 or later (only for Visual C++ 6.0) +- STLport 4.6.2 or later (only for Visual C++ 6.0) - Berkeley DB 4.5.20 - expat 2.0 - OpenSSL 0.9.7 or later (OpenSSL 0.9.8 or later recommended) diff --git a/cpp/allTests.py b/cpp/allTests.py index ac2b0eff2da..1394e3039af 100755 --- a/cpp/allTests.py +++ b/cpp/allTests.py @@ -94,6 +94,7 @@ tests = [ \ "Ice/servantLocator", \ "Ice/threads", \ "Ice/interceptor", \ + "Ice/stringConverter", \ "IceSSL/configuration", \ "Freeze/dbmap", \ "Freeze/complex", \ diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules index ff4f49369ee..b855cde8dab 100644 --- a/cpp/config/Make.rules +++ b/cpp/config/Make.rules @@ -122,8 +122,6 @@ libdir = $(top_srcdir)/lib includedir = $(top_srcdir)/include slicedir = $(top_srcdir)/slice -install_bindir = $(prefix)/bin - install_includedir = $(prefix)/include install_slicedir = $(prefix)/slice install_schemadir = $(prefix)/schema @@ -144,9 +142,11 @@ UNAME := $(shell uname) include $(top_srcdir)/config/Make.rules.$(UNAME) ifeq ($(LP64),yes) + install_bindir := $(prefix)/bin$(lp64binsuffix) install_libdir := $(prefix)/lib$(lp64suffix) libsubdir := lib$(lp64suffix) else + install_bindir := $(prefix)/bin install_libdir := $(prefix)/lib libsubdir := lib endif diff --git a/cpp/config/Make.rules.HP-UX b/cpp/config/Make.rules.HP-UX index 088e8485737..903d2a4a480 100644 --- a/cpp/config/Make.rules.HP-UX +++ b/cpp/config/Make.rules.HP-UX @@ -76,6 +76,7 @@ ICEUTIL_OS_LIBS = -lpthread -lrt ICE_OS_LIBS = lp64suffix = /pa20_64 +lp64binsuffix = /pa20_64 ifeq ($(LP64),yes) export LD_LIBRARY_PATH := $(libdir):$(LD_LIBRARY_PATH) diff --git a/cpp/config/Make.rules.SunOS b/cpp/config/Make.rules.SunOS index 8fb40abe276..f3348cb04ec 100644 --- a/cpp/config/Make.rules.SunOS +++ b/cpp/config/Make.rules.SunOS @@ -155,9 +155,11 @@ ICE_OS_LIBS = -ldl -lsocket ifeq ($(MACHINE_TYPE),sun4u) lp64suffix = /sparcv9 + lp64binsuffix = /sparcv9 endif ifeq ($(MACHINE_TYPE),i86pc) lp64suffix = /amd64 + lp64binsuffix = /amd64 endif ifeq ($(LP64),yes) diff --git a/cpp/config/Make.rules.bcc b/cpp/config/Make.rules.bcc index a6ba68473c3..4b9172a870c 100644 --- a/cpp/config/Make.rules.bcc +++ b/cpp/config/Make.rules.bcc @@ -55,3 +55,4 @@ LIBS = ice$(LIBSUFFIX).lib $(BASELIBS) BZIP2_LIBS = libbz2.lib DB_LIBS = libdb45.lib +ICONV_LIB = libiconv-bcc.lib
\ No newline at end of file diff --git a/cpp/config/Make.rules.msvc b/cpp/config/Make.rules.msvc index ee3ebf5fb5b..d7002b2ec06 100755 --- a/cpp/config/Make.rules.msvc +++ b/cpp/config/Make.rules.msvc @@ -88,3 +88,4 @@ LIBS = ice$(LIBSUFFIX).lib $(BASELIBS) BZIP2_LIBS = libbz2$(LIBSUFFIX).lib DB_LIBS = libdb45$(LIBSUFFIX).lib +ICONV_LIB = libiconv.lib
\ No newline at end of file diff --git a/cpp/demo/Freeze/customEvictor/customevictC.dsp b/cpp/demo/Freeze/customEvictor/customevictC.dsp new file mode 100755 index 00000000000..fbd1430db29 --- /dev/null +++ b/cpp/demo/Freeze/customEvictor/customevictC.dsp @@ -0,0 +1,118 @@ +# Microsoft Developer Studio Project File - Name="customevictC" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=customevictC - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "customevictC.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "customevictC.mak" CFG="customevictC - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "customevictC - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "customevictC - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "customevictC - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "../../../include/stlport" /I "dummyinclude" /D "_CONSOLE" /D "NDEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Freeze.lib Ice.lib IceUtil.lib setargv.obj /nologo /subsystem:console /pdb:none /machine:I386 /out:"client.exe" /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /debug
+
+!ELSEIF "$(CFG)" == "customevictC - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /I "dummyinclude" /D "_CONSOLE" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /GZ /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Freezed.lib Iced.lib IceUtild.lib setargv.obj /nologo /subsystem:console /debug /machine:I386 /out:"client.exe" /pdbtype:sept /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "customevictC - Win32 Release"
+# Name "customevictC - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Item.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Item.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Target
+# End Project
diff --git a/cpp/demo/Freeze/customEvictor/customevictS.dsp b/cpp/demo/Freeze/customEvictor/customevictS.dsp new file mode 100755 index 00000000000..90936130fee --- /dev/null +++ b/cpp/demo/Freeze/customEvictor/customevictS.dsp @@ -0,0 +1,248 @@ +# Microsoft Developer Studio Project File - Name="customevictS" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=customevictS - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "customevictS.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "customevictS.mak" CFG="customevictS - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "customevictS - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "customevictS - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "customevictS - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "NDEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Freeze.lib Ice.lib IceUtil.lib setargv.obj /nologo /subsystem:console /pdb:none /machine:I386 /out:"server.exe" /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /debug
+
+!ELSEIF "$(CFG)" == "customevictS - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /FD /GZ /c
+# SUBTRACT CPP /Fr /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Freezed.lib Iced.lib IceUtild.lib setargv.obj /nologo /subsystem:console /debug /machine:I386 /out:"server.exe" /pdbtype:sept /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "customevictS - Win32 Release"
+# Name "customevictS - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\CurrentDatabase.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Database.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Evictor.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\EvictorBase.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Item.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ItemI.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ItemInfo.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Server.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\SimpleEvictor.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\CurrentDatabase.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Database.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Evictor.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\EvictorBase.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Item.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ItemI.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ItemInfo.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\SimpleEvictor.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Item.ice
+
+!IF "$(CFG)" == "customevictS - Win32 Release"
+
+# Begin Custom Build
+InputPath=.\Item.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Item.ice
+
+"Item.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Item.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "customevictS - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\Item.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Item.ice
+
+"Item.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Item.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\ItemInfo.ice
+
+!IF "$(CFG)" == "customevictS - Win32 Release"
+
+# Begin Custom Build
+InputPath=.\ItemInfo.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe ItemInfo.ice
+
+"ItemInfo.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"ItemInfo.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "customevictS - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\ItemInfo.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe ItemInfo.ice
+
+"ItemInfo.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"ItemInfo.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Target
+# End Project
diff --git a/cpp/demo/book/freeze_filesystem/README b/cpp/demo/book/freeze_filesystem/README new file mode 100644 index 00000000000..1eb77d69e29 --- /dev/null +++ b/cpp/demo/book/freeze_filesystem/README @@ -0,0 +1,10 @@ +This demo presents an alternate implementation of the filesystem +application, as discussed in the Freeze chapter of the Ice manual. + +To run it, start the server in a window: + +$ server + +Then run the client in a separate window: + +$ client diff --git a/cpp/demo/book/freeze_filesystem/freezefsC.dsp b/cpp/demo/book/freeze_filesystem/freezefsC.dsp new file mode 100755 index 00000000000..a2979f1a551 --- /dev/null +++ b/cpp/demo/book/freeze_filesystem/freezefsC.dsp @@ -0,0 +1,200 @@ +# Microsoft Developer Studio Project File - Name="freezefsC" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=freezefsC - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "freezefsC.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "freezefsC.mak" CFG="freezefsC - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "freezefsC - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "freezefsC - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "freezefsC - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_UNICODE" /D "NDEBUG" /D "WIN32_LEAN_AND_MEAN" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Ice.lib IceUtil.lib setargv.obj /nologo /subsystem:console /pdb:none /machine:I386 /out:"client.exe" /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /debug
+
+!ELSEIF "$(CFG)" == "freezefsC - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /Fp"Debug/Filesystem.pch" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Iced.lib IceUtild.lib setargv.obj /nologo /subsystem:console /debug /machine:I386 /out:"client.exe" /pdbtype:sept /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "freezefsC - Win32 Release"
+# Name "freezefsC - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\Client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Filesystem.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\PersistentFilesystem.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\Filesystem.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\PersistentFilesystem.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\Filesystem.ice
+
+!IF "$(CFG)" == "freezefsC - Win32 Release"
+
+USERDEP__FILES="../../../bin/slice2cpp.exe"
+# Begin Custom Build
+InputPath=.\Filesystem.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Filesystem.ice
+
+"Filesystem.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Filesystem.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "freezefsC - Win32 Debug"
+
+USERDEP__FILES="..\..\..\bin\slice2cpp.exe"
+# Begin Custom Build
+InputPath=.\Filesystem.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Filesystem.ice
+
+"Filesystem.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Filesystem.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\PersistentFilesystem.ice
+
+!IF "$(CFG)" == "freezefsC - Win32 Release"
+
+# Begin Custom Build
+InputPath=.\PersistentFilesystem.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe PersistentFilesystem.ice
+
+"PersistentFilesystem.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"PersistentFilesystem.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "freezefsC - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\PersistentFilesystem.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe PersistentFilesystem.ice
+
+"PersistentFilesystem.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"PersistentFilesystem.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Target
+# End Project
diff --git a/cpp/demo/book/freeze_filesystem/freezefsS.dsp b/cpp/demo/book/freeze_filesystem/freezefsS.dsp new file mode 100755 index 00000000000..699dbc2d46b --- /dev/null +++ b/cpp/demo/book/freeze_filesystem/freezefsS.dsp @@ -0,0 +1,212 @@ +# Microsoft Developer Studio Project File - Name="freezefsS" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=freezefsS - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "freezefsS.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "freezefsS.mak" CFG="freezefsS - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "freezefsS - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "freezefsS - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "freezefsS - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /WX /GR /GX /O2 /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_UNICODE" /D "NDEBUG" /D "WIN32_LEAN_AND_MEAN" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Freeze Ice.lib IceUtil.lib setargv.obj /nologo /subsystem:console /pdb:none /machine:I386 /out:"server.exe" /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /debug
+
+!ELSEIF "$(CFG)" == "freezefsS - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../../include" /I "../../../include/stlport" /D "_CONSOLE" /D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /Fp"Debug/Filesystem.pch" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Freezed.lib Iced.lib IceUtild.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"server.exe" /pdbtype:sept /libpath:"../../../lib" /FIXED:no
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "freezefsS - Win32 Release"
+# Name "freezefsS - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Filesystem.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\PersistentFilesystem.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\PersistentFilesystemI.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Server.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Filesystem.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\FilesystemI.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\PersistentFilesystem.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\PersistentFilesystemI.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Filesystem.ice
+
+!IF "$(CFG)" == "freezefsS - Win32 Release"
+
+USERDEP__FILES="..\..\..\bin\slice2cpp.exe"
+# Begin Custom Build
+InputPath=.\Filesystem.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Filesystem.ice
+
+"Filesystem.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Filesystem.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "freezefsS - Win32 Debug"
+
+USERDEP__FILES="..\..\..\bin\slice2cpp.exe"
+# Begin Custom Build
+InputPath=.\Filesystem.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe Filesystem.ice
+
+"Filesystem.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Filesystem.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\PersistentFilesystem.ice
+
+!IF "$(CFG)" == "freezefsS - Win32 Release"
+
+# Begin Custom Build
+InputPath=.\PersistentFilesystem.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe PersistentFilesystem.ice
+
+"PersistentFilesystem.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"PersistentFilesystem.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "freezefsS - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\PersistentFilesystem.ice
+
+BuildCmds= \
+ ..\..\..\bin\slice2cpp.exe PersistentFilesystem.ice
+
+"PersistentFilesystem.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"PersistentFilesystem.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\README
+# End Source File
+# End Target
+# End Project
diff --git a/cpp/demo/demo.dsw b/cpp/demo/demo.dsw index 5fa54905c24..5c809b74e5b 100755 --- a/cpp/demo/demo.dsw +++ b/cpp/demo/demo.dsw @@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00 ###############################################################################
-Project: "all"=".\demo.dsp" - Package Owner=<4>
+Project: "all"=.\demo.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -191,11 +191,71 @@ Package=<4> Begin Project Dependency
Project_Dep_Name replicationS
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name freezefsC
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name freezefsS
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name customevictC
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name customevictS
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "allocateC"=.\IceGrid\allocate\allocateC.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "allocateS"=.\IceGrid\allocate\allocateS.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "asyncC"=.\Ice\async\asyncC.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "asyncS"=.\Ice\async\asyncS.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
}}}
###############################################################################
-Project: "allocateC"=".\IceGrid\allocate\allocateC.dsp" - Package Owner=<4>
+Project: "bench"=.\freeze\bench\bench.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -207,7 +267,7 @@ Package=<4> ###############################################################################
-Project: "allocateS"=".\IceGrid\allocate\allocateS.dsp" - Package Owner=<4>
+Project: "bidirC"=.\Ice\bidir\bidirC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -219,7 +279,7 @@ Package=<4> ###############################################################################
-Project: "asyncC"=".\Ice\async\asyncC.dsp" - Package Owner=<4>
+Project: "bidirS"=.\Ice\bidir\bidirS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -231,7 +291,7 @@ Package=<4> ###############################################################################
-Project: "asyncS"=".\Ice\async\asyncS.dsp" - Package Owner=<4>
+Project: "callbackC"=.\ice\callback\callbackC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -243,7 +303,7 @@ Package=<4> ###############################################################################
-Project: "bench"=".\freeze\bench\bench.dsp" - Package Owner=<4>
+Project: "callbackS"=.\ice\callback\callbackS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -255,7 +315,7 @@ Package=<4> ###############################################################################
-Project: "bidirC"=".\Ice\bidir\bidirC.dsp" - Package Owner=<4>
+Project: "chatC"=.\Glacier2\chat\chatC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -267,7 +327,7 @@ Package=<4> ###############################################################################
-Project: "bidirS"=".\Ice\bidir\bidirS.dsp" - Package Owner=<4>
+Project: "chatS"=.\Glacier2\chat\chatS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -279,7 +339,7 @@ Package=<4> ###############################################################################
-Project: "callbackC"=".\ice\callback\callbackC.dsp" - Package Owner=<4>
+Project: "clockC"=.\iceStorm\clock\clockC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -291,7 +351,7 @@ Package=<4> ###############################################################################
-Project: "callbackS"=".\ice\callback\callbackS.dsp" - Package Owner=<4>
+Project: "clockS"=.\iceStorm\clock\clockS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -303,7 +363,7 @@ Package=<4> ###############################################################################
-Project: "chatC"=".\Glacier2\chat\chatC.dsp" - Package Owner=<4>
+Project: "converterC"=.\Ice\converter\converterC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -315,7 +375,7 @@ Package=<4> ###############################################################################
-Project: "chatS"=".\Glacier2\chat\chatS.dsp" - Package Owner=<4>
+Project: "converterS"=.\Ice\converter\converterS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -327,7 +387,7 @@ Package=<4> ###############################################################################
-Project: "clockC"=".\iceStorm\clock\clockC.dsp" - Package Owner=<4>
+Project: "counterC"=.\IceStorm\counter\counterC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -339,7 +399,7 @@ Package=<4> ###############################################################################
-Project: "clockS"=".\iceStorm\clock\clockS.dsp" - Package Owner=<4>
+Project: "counterS"=.\IceStorm\counter\counterS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -351,7 +411,7 @@ Package=<4> ###############################################################################
-Project: "converterC"=".\Ice\converter\converterC.dsp" - Package Owner=<4>
+Project: "customevictC"=.\Freeze\customEvictor\customevictC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -363,7 +423,7 @@ Package=<4> ###############################################################################
-Project: "converterS"=".\Ice\converter\converterS.dsp" - Package Owner=<4>
+Project: "customevictS"=.\Freeze\customEvictor\customevictS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -375,7 +435,7 @@ Package=<4> ###############################################################################
-Project: "counterC"=".\IceStorm\counter\counterC.dsp" - Package Owner=<4>
+Project: "freezefsC"=.\book\freeze_filesystem\freezefsC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -387,7 +447,7 @@ Package=<4> ###############################################################################
-Project: "counterS"=".\IceStorm\counter\counterS.dsp" - Package Owner=<4>
+Project: "freezefsS"=.\book\freeze_filesystem\freezefsS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -399,7 +459,7 @@ Package=<4> ###############################################################################
-Project: "glacier2callbackC"=".\glacier2\callback\glacier2callbackC.dsp" - Package Owner=<4>
+Project: "glacier2callbackC"=.\glacier2\callback\glacier2callbackC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -411,7 +471,7 @@ Package=<4> ###############################################################################
-Project: "glacier2callbackS"=".\glacier2\callback\glacier2callbackS.dsp" - Package Owner=<4>
+Project: "glacier2callbackS"=.\glacier2\callback\glacier2callbackS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -423,7 +483,7 @@ Package=<4> ###############################################################################
-Project: "glacier2callbackSS"=".\glacier2\callback\glacier2callbackSS.dsp" - Package Owner=<4>
+Project: "glacier2callbackSS"=.\glacier2\callback\glacier2callbackSS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -435,7 +495,7 @@ Package=<4> ###############################################################################
-Project: "helloC"=".\ice\hello\helloC.dsp" - Package Owner=<4>
+Project: "helloC"=.\ice\hello\helloC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -447,7 +507,7 @@ Package=<4> ###############################################################################
-Project: "helloS"=".\ice\hello\helloS.dsp" - Package Owner=<4>
+Project: "helloS"=.\ice\hello\helloS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -459,7 +519,7 @@ Package=<4> ###############################################################################
-Project: "helloiceboxC"=".\icebox\hello\helloiceboxC.dsp" - Package Owner=<4>
+Project: "helloiceboxC"=.\icebox\hello\helloiceboxC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -471,7 +531,7 @@ Package=<4> ###############################################################################
-Project: "helloiceboxS"=".\icebox\hello\helloiceboxS.dsp" - Package Owner=<4>
+Project: "helloiceboxS"=.\icebox\hello\helloiceboxS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -483,7 +543,7 @@ Package=<4> ###############################################################################
-Project: "invokeC"=".\ice\invoke\invokeC.dsp" - Package Owner=<4>
+Project: "invokeC"=.\ice\invoke\invokeC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -495,7 +555,7 @@ Package=<4> ###############################################################################
-Project: "invokeS"=".\ice\invoke\invokeS.dsp" - Package Owner=<4>
+Project: "invokeS"=.\ice\invoke\invokeS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -507,7 +567,7 @@ Package=<4> ###############################################################################
-Project: "latencyC"=".\ice\latency\latencyC.dsp" - Package Owner=<4>
+Project: "latencyC"=.\ice\latency\latencyC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -519,7 +579,7 @@ Package=<4> ###############################################################################
-Project: "latencyS"=".\ice\latency\latencyS.dsp" - Package Owner=<4>
+Project: "latencyS"=.\ice\latency\latencyS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -531,7 +591,7 @@ Package=<4> ###############################################################################
-Project: "libraryC"=".\freeze\library\libraryC.dsp" - Package Owner=<4>
+Project: "libraryC"=.\freeze\library\libraryC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -543,7 +603,7 @@ Package=<4> ###############################################################################
-Project: "libraryCOL"=".\freeze\library\libraryCOL.dsp" - Package Owner=<4>
+Project: "libraryCOL"=.\freeze\library\libraryCOL.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -555,7 +615,7 @@ Package=<4> ###############################################################################
-Project: "libraryS"=".\freeze\library\libraryS.dsp" - Package Owner=<4>
+Project: "libraryS"=.\freeze\library\libraryS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -567,7 +627,7 @@ Package=<4> ###############################################################################
-Project: "mfchelloC"=".\ice\MFC\client\mfchelloC.dsp" - Package Owner=<4>
+Project: "mfchelloC"=.\ice\MFC\client\mfchelloC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -579,7 +639,7 @@ Package=<4> ###############################################################################
-Project: "mfchelloS"=".\ice\MFC\server\mfchelloS.dsp" - Package Owner=<4>
+Project: "mfchelloS"=.\ice\MFC\server\mfchelloS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -591,7 +651,7 @@ Package=<4> ###############################################################################
-Project: "mfcpatchC"=".\IcePatch2\MFC\mfcpatchC.dsp" - Package Owner=<4>
+Project: "mfcpatchC"=.\IcePatch2\MFC\mfcpatchC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -603,7 +663,7 @@ Package=<4> ###############################################################################
-Project: "minimalC"=".\Ice\minimal\minimalC.dsp" - Package Owner=<4>
+Project: "minimalC"=.\Ice\minimal\minimalC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -615,7 +675,7 @@ Package=<4> ###############################################################################
-Project: "minimalS"=".\Ice\minimal\minimalS.dsp" - Package Owner=<4>
+Project: "minimalS"=.\Ice\minimal\minimalS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -627,7 +687,7 @@ Package=<4> ###############################################################################
-Project: "nestedC"=".\ice\nested\nestedC.dsp" - Package Owner=<4>
+Project: "nestedC"=.\ice\nested\nestedC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -639,7 +699,7 @@ Package=<4> ###############################################################################
-Project: "nestedS"=".\ice\nested\nestedS.dsp" - Package Owner=<4>
+Project: "nestedS"=.\ice\nested\nestedS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -651,7 +711,7 @@ Package=<4> ###############################################################################
-Project: "phonebookC"=".\freeze\phonebook\phonebookC.dsp" - Package Owner=<4>
+Project: "phonebookC"=.\freeze\phonebook\phonebookC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -663,7 +723,7 @@ Package=<4> ###############################################################################
-Project: "phonebookCOL"=".\freeze\phonebook\phonebookCOL.dsp" - Package Owner=<4>
+Project: "phonebookCOL"=.\freeze\phonebook\phonebookCOL.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -675,7 +735,7 @@ Package=<4> ###############################################################################
-Project: "phonebookS"=".\freeze\phonebook\phonebookS.dsp" - Package Owner=<4>
+Project: "phonebookS"=.\freeze\phonebook\phonebookS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -687,7 +747,7 @@ Package=<4> ###############################################################################
-Project: "printerC"=".\book\printer\printerC.dsp" - Package Owner=<4>
+Project: "printerC"=.\book\printer\printerC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -699,7 +759,7 @@ Package=<4> ###############################################################################
-Project: "printerS"=".\book\printer\printerS.dsp" - Package Owner=<4>
+Project: "printerS"=.\book\printer\printerS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -711,7 +771,7 @@ Package=<4> ###############################################################################
-Project: "replicatedC"=".\IceStorm\replicated\replicatedC.dsp" - Package Owner=<4>
+Project: "replicatedC"=.\IceStorm\replicated\replicatedC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -723,7 +783,7 @@ Package=<4> ###############################################################################
-Project: "replicatedS"=".\IceStorm\replicated\replicatedS.dsp" - Package Owner=<4>
+Project: "replicatedS"=.\IceStorm\replicated\replicatedS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -735,7 +795,7 @@ Package=<4> ###############################################################################
-Project: "replicationC"=".\IceGrid\replication\replicationC.dsp" - Package Owner=<4>
+Project: "replicationC"=.\IceGrid\replication\replicationC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -747,7 +807,7 @@ Package=<4> ###############################################################################
-Project: "replicationS"=".\IceGrid\replication\replicationS.dsp" - Package Owner=<4>
+Project: "replicationS"=.\IceGrid\replication\replicationS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -759,7 +819,7 @@ Package=<4> ###############################################################################
-Project: "sessionActivationC"=".\IceGrid\sessionActivation\sessionActivationC.dsp" - Package Owner=<4>
+Project: "sessionActivationC"=.\IceGrid\sessionActivation\sessionActivationC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -771,7 +831,7 @@ Package=<4> ###############################################################################
-Project: "sessionActivationS"=".\IceGrid\sessionActivation\sessionActivationS.dsp" - Package Owner=<4>
+Project: "sessionActivationS"=.\IceGrid\sessionActivation\sessionActivationS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -783,7 +843,7 @@ Package=<4> ###############################################################################
-Project: "sessionC"=".\Ice\session\sessionC.dsp" - Package Owner=<4>
+Project: "sessionC"=.\Ice\session\sessionC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -795,7 +855,7 @@ Package=<4> ###############################################################################
-Project: "sessionS"=".\Ice\session\sessionS.dsp" - Package Owner=<4>
+Project: "sessionS"=.\Ice\session\sessionS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -807,7 +867,7 @@ Package=<4> ###############################################################################
-Project: "simpleC"=".\IceGrid\simple\simpleC.dsp" - Package Owner=<4>
+Project: "simpleC"=.\IceGrid\simple\simpleC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -819,7 +879,7 @@ Package=<4> ###############################################################################
-Project: "simpleS"=".\IceGrid\simple\simpleS.dsp" - Package Owner=<4>
+Project: "simpleS"=.\IceGrid\simple\simpleS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -831,7 +891,7 @@ Package=<4> ###############################################################################
-Project: "simplefsC"=".\book\simple_filesystem\simplefsC.dsp" - Package Owner=<4>
+Project: "simplefsC"=.\book\simple_filesystem\simplefsC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -843,7 +903,7 @@ Package=<4> ###############################################################################
-Project: "simplefsS"=".\book\simple_filesystem\simplefsS.dsp" - Package Owner=<4>
+Project: "simplefsS"=.\book\simple_filesystem\simplefsS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -855,7 +915,7 @@ Package=<4> ###############################################################################
-Project: "throughputC"=".\ice\throughput\throughputC.dsp" - Package Owner=<4>
+Project: "throughputC"=.\ice\throughput\throughputC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -867,7 +927,7 @@ Package=<4> ###############################################################################
-Project: "throughputS"=".\ice\throughput\throughputS.dsp" - Package Owner=<4>
+Project: "throughputS"=.\ice\throughput\throughputS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -879,7 +939,7 @@ Package=<4> ###############################################################################
-Project: "valueC"=".\ice\value\valueC.dsp" - Package Owner=<4>
+Project: "valueC"=.\ice\value\valueC.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -891,7 +951,7 @@ Package=<4> ###############################################################################
-Project: "valueS"=".\ice\value\valueS.dsp" - Package Owner=<4>
+Project: "valueS"=.\ice\value\valueS.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -903,7 +963,7 @@ Package=<4> ###############################################################################
-Project: "workqueue"=".\iceutil\workqueue\workqueue.dsp" - Package Owner=<4>
+Project: "workqueue"=.\iceutil\workqueue\workqueue.dsp - Package Owner=<4>
Package=<5>
{{{
diff --git a/cpp/include/Ice/Ice.h b/cpp/include/Ice/Ice.h index 4d8f53a8703..85de61f222e 100644 --- a/cpp/include/Ice/Ice.h +++ b/cpp/include/Ice/Ice.h @@ -34,4 +34,8 @@ #include <Ice/Router.h> #include <Ice/DispatchInterceptor.h> +#ifndef _WIN32 +#include <Ice/IconvStringConverter.h> +#endif + #endif diff --git a/cpp/include/Ice/IconvStringConverter.h b/cpp/include/Ice/IconvStringConverter.h index 8504ea2f2b0..8b532c8739e 100644 --- a/cpp/include/Ice/IconvStringConverter.h +++ b/cpp/include/Ice/IconvStringConverter.h @@ -10,17 +10,28 @@ #ifndef ICE_ICONV_STRING_CONVERTER #define ICE_ICONV_STRING_CONVERTER -#include <Ice/Ice.h> +#include <Ice/StringConverter.h> #include <algorithm> #include <iconv.h> -#ifdef _LIBICONV_VERSION +#ifndef _WIN32 +#include <langinfo.h> +#endif + +#if defined(_LIBICONV_VERSION) || (defined(__sun) && !defined(_XPG6)) + // + // See http://sourceware.org/bugzilla/show_bug.cgi?id=2962 + // +# define ICE_CONST_ICONV_INBUF 1 +#endif + // -// See http://sourceware.org/bugzilla/show_bug.cgi?id=2962 +// On Windows, we need to be very careful with errno: if we use different C +// runtime libraries for the main program and the libiconv DLL, we end up with +// two different errnos ... a not-so-good work-around is to ignore errno +// altogether, by defining ICE_NO_ERRNO // -#define ICE_CONST_ICONV_INBUF 1 -#endif namespace Ice { @@ -37,14 +48,17 @@ class IconvStringConverter : public Ice::BasicStringConverter<charT> { public: - IconvStringConverter(const char* internalCode); +#ifdef _WIN32 + IconvStringConverter(const char*); +#else + IconvStringConverter(const char* = nl_langinfo(CODESET)); +#endif virtual ~IconvStringConverter(); - virtual Ice::Byte* toUTF8(const charT* sourceStart, const charT* sourceEnd, Ice::UTF8Buffer& buf) const; + virtual Ice::Byte* toUTF8(const charT*, const charT*, Ice::UTF8Buffer&) const; - virtual void fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, - std::basic_string<charT>& target) const; + virtual void fromUTF8(const Ice::Byte*, const Ice::Byte*, std::basic_string<charT>&) const; private: @@ -59,7 +73,6 @@ private: #else mutable pthread_key_t _key; #endif - const char* _internalCode; }; @@ -67,6 +80,13 @@ private: // Implementation // +#ifdef __SUNPRO_CC +extern "C" +{ + typedef void (*IcePthreadKeyDestructor)(void*); +} +#endif + template<typename charT> IconvStringConverter<charT>::IconvStringConverter(const char* internalCode) : _internalCode(internalCode) @@ -93,7 +113,12 @@ IconvStringConverter<charT>::IconvStringConverter(const char* internalCode) : throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } #else + #ifdef __SUNPRO_CC + int rs = pthread_key_create(&_key, reinterpret_cast<IcePthreadKeyDestructor>(&cleanupKey)); + #else int rs = pthread_key_create(&_key, &cleanupKey); + #endif + if(rs != 0) { throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, rs); @@ -108,7 +133,7 @@ IconvStringConverter<charT>::~IconvStringConverter() void* val = TlsGetValue(_key); if(val != 0) { - clearnupKey(val); + cleanupKey(val); } if(TlsFree(_key) == 0) { @@ -139,7 +164,7 @@ IconvStringConverter<charT>::createDescriptors() const { throw Ice::StringConversionException( __FILE__, __LINE__, - std::string("iconv can convert from ") + std::string("iconv cannot convert from ") + externalCode + " to " + _internalCode); } @@ -150,8 +175,7 @@ IconvStringConverter<charT>::createDescriptors() const throw Ice::StringConversionException( __FILE__, __LINE__, - std::string("iconv can convert from ") + _internalCode + " to " + externalCode); - + std::string("iconv cannot convert from ") + _internalCode + " to " + externalCode); } return cdp; } @@ -227,7 +251,6 @@ IconvStringConverter<charT>::toUTF8(const charT* sourceStart, const charT* sourc Ice::Byte* outbuf = 0; size_t count = 0; - // // Loop while we need more buffer space // @@ -236,8 +259,12 @@ IconvStringConverter<charT>::toUTF8(const charT* sourceStart, const charT* sourc size_t howMany = std::max(inbytesleft, size_t(4)); outbuf = buf.getMoreBytes(howMany, outbuf); count = iconv(cd, &inbuf, &inbytesleft, reinterpret_cast<char**>(&outbuf), &howMany); +#ifdef ICE_NO_ERRNO + } while(count == size_t(-1)); +#else } while(count == size_t(-1) && errno == E2BIG); - +#endif + if(count == size_t(-1)) { throw Ice::StringConversionException(__FILE__, __LINE__); @@ -298,7 +325,11 @@ IconvStringConverter<charT>::fromUTF8(const Ice::Byte* sourceStart, const Ice::B buf = newbuf; count = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); +#ifdef ICE_NO_ERRNO + } while(count == size_t(-1)); +#else } while(count == size_t(-1) && errno == E2BIG); +#endif if(count == size_t(-1)) { diff --git a/cpp/include/Ice/StringConverter.h b/cpp/include/Ice/StringConverter.h index d2aa1dffa7a..2b59c622e8b 100755 --- a/cpp/include/Ice/StringConverter.h +++ b/cpp/include/Ice/StringConverter.h @@ -70,11 +70,32 @@ class ICE_API UnicodeWstringConverter : public WstringConverter { public: - virtual Byte* toUTF8(const wchar_t* sourceStart, const wchar_t* sourceEnd, - UTF8Buffer&) const; + virtual Byte* toUTF8(const wchar_t*, const wchar_t*, UTF8Buffer&) const; - virtual void fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, - std::wstring& target) const; + virtual void fromUTF8(const Byte*, const Byte*, std::wstring&) const; }; + +#ifdef _WIN32 + +// +// Converts to/from UTF-8 using MultiByteToWideChar and WideCharToMultiByte +// + +class ICE_API WindowsStringConverter : public StringConverter +{ +public: + + explicit WindowsStringConverter(unsigned int); + + virtual Byte* toUTF8(const char*, const char*, UTF8Buffer&) const; + + virtual void fromUTF8(const Byte*, const Byte*, std::string& target) const; + +private: + unsigned int _cp; + UnicodeWstringConverter _unicodeWstringConverter; +}; +#endif + } #endif diff --git a/cpp/install/common/makewindist.py b/cpp/install/common/makewindist.py index 29a8574afee..8b31fe23d88 100755 --- a/cpp/install/common/makewindist.py +++ b/cpp/install/common/makewindist.py @@ -265,9 +265,9 @@ def buildIceDists(stageDir, sourcesDir, sourcesVersion, installVersion): setOptimize(os.path.join(os.getcwd(), "config", "Make.rules.mak.vb"), False) f = fileinput.input(os.path.join(os.getcwd(), "config", "Make.rules.mak.vb"), True) for l in f: - i = l.find("icecs") + i = l.find("\\cs\\") if i <> -1: - print l.rstrip('\n').replace("icecs", "IceCS-%s" % sourcesVersion) + print l.rstrip('\n').replace("\\cs\\", "\\IceCS-%s\\" % sourcesVersion) else: print l.rstrip('\n') @@ -292,9 +292,9 @@ def buildIceDists(stageDir, sourcesDir, sourcesVersion, installVersion): setOptimize(os.path.join(os.getcwd(), "config", "Make.rules.mak.vb"), True) f = fileinput.input(os.path.join(os.getcwd(), "config", "Make.rules.mak.vb"), True) for l in f: - i = l.find("icecs") + i = l.find("\\cs\\") if i <> -1: - print l.rstrip('\n').replace("icecs", "IceCS-%s" % sourcesVersion) + print l.rstrip('\n').replace("\\cs\\", "\\IceCS-%s\\" % sourcesVersion) else: print l.rstrip('\n') diff --git a/cpp/install/vc60/doc/README.txt b/cpp/install/vc60/doc/README.txt index a45f47ff707..136a99fa6b0 100755 --- a/cpp/install/vc60/doc/README.txt +++ b/cpp/install/vc60/doc/README.txt @@ -375,6 +375,20 @@ compiled against the <x>.<y>.<z> run time will automatically use the <x>.<y>.<z or z+n> assemblies.
+Ice and the Windows Registry
+----------------------------
+
+The Ice installer adds information to the Windows registry to indicate
+where it was installed. Developers can use this information to locate
+the Ice files in their applications.
+
+The registration key used by this installer is:
+
+HKEY_LOCAL_MACHINE\Software\ZeroC\Ice @ver@ for Visual Studio 6.0
+
+To install location is stored as a string value named 'InstallDir'.
+
+
Acknowledgments
---------------
diff --git a/cpp/install/vc71/doc/README.txt b/cpp/install/vc71/doc/README.txt index 01f4a0afae4..15362034e09 100755 --- a/cpp/install/vc71/doc/README.txt +++ b/cpp/install/vc71/doc/README.txt @@ -122,6 +122,20 @@ compiled against the <x>.<y>.<z> run time will automatically use the <x>.<y>.<z or z+n> assemblies.
+Ice and the Windows Registry
+----------------------------
+
+The Ice installer adds information to the Windows registry to indicate
+where it was installed. Developers can use this information to locate
+the Ice files in their applications.
+
+The registration key used by this installer is:
+
+HKEY_LOCAL_MACHINE\Software\ZeroC\Ice @ver@ for Visual Studio .NET 2003
+
+To install location is stored as a string value named 'InstallDir'.
+
+
Acknowledgments
---------------
diff --git a/cpp/install/vc80/doc/README.txt b/cpp/install/vc80/doc/README.txt index a0f4bc14d2c..1d6681d275d 100755 --- a/cpp/install/vc80/doc/README.txt +++ b/cpp/install/vc80/doc/README.txt @@ -294,6 +294,20 @@ compiled against the <x>.<y>.<z> run time will automatically use the <x>.<y>.<z or z+n> assemblies.
+Ice and the Windows Registry
+----------------------------
+
+The Ice installer adds information to the Windows registry to indicate
+where it was installed. Developers can use this information to locate
+the Ice files in their applications.
+
+The registration key used by this installer is:
+
+HKEY_LOCAL_MACHINE\Software\ZeroC\Ice @ver@ for Visual Studio 2005
+
+To install location is stored as a string value named 'InstallDir'.
+
+
Acknowledgments
---------------
diff --git a/cpp/install/vc80_x64/doc/README.txt b/cpp/install/vc80_x64/doc/README.txt index 47a4bac7d46..9522df6753e 100755 --- a/cpp/install/vc80_x64/doc/README.txt +++ b/cpp/install/vc80_x64/doc/README.txt @@ -112,6 +112,20 @@ compiled against the <x>.<y>.<z> run time will automatically use the <x>.<y>.<z or z+n> assemblies.
+Ice and the Windows Registry
+----------------------------
+
+The Ice installer adds information to the Windows registry to indicate
+where it was installed. Developers can use this information to locate
+the Ice files in their applications.
+
+The registration key used by this installer is:
+
+HKEY_LOCAL_MACHINE\Software\ZeroC\Ice @ver@ for Visual Studio 2005 (x64)
+
+To install location is stored as a string value named 'InstallDir'.
+
+
Acknowledgments
---------------
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index d4ae7b27c76..dbb7524c0f0 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -409,15 +409,22 @@ IceInternal::Instance::stringToIdentity(const string& s) const if(_initData.stringConverter) { string tmpString; - _initData.stringConverter->fromUTF8(reinterpret_cast<const Byte*>(ident.name.data()), - reinterpret_cast<const Byte*>(ident.name.data() + ident.name.size()), - tmpString); - ident.name = tmpString; + if(!ident.name.empty()) + { + _initData.stringConverter->fromUTF8(reinterpret_cast<const Byte*>(ident.name.data()), + reinterpret_cast<const Byte*>(ident.name.data() + ident.name.size()), + tmpString); + ident.name = tmpString; + } - _initData.stringConverter->fromUTF8(reinterpret_cast<const Byte*>(ident.category.data()), - reinterpret_cast<const Byte*>(ident.category.data() + ident.category.size()), - tmpString); - ident.category = tmpString; + if(!ident.category.empty()) + { + _initData.stringConverter->fromUTF8(reinterpret_cast<const Byte*>(ident.category.data()), + reinterpret_cast<const Byte*>(ident.category.data() + + ident.category.size()), + tmpString); + ident.category = tmpString; + } } return ident; @@ -431,14 +438,21 @@ IceInternal::Instance::identityToString(const Identity& ident) const if(_initData.stringConverter) { UTF8BufferI buffer; - Byte* last = _initData.stringConverter->toUTF8(ident.name.data(), ident.name.data() + ident.name.size(), - buffer); - name = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); + Byte* last; + if(!ident.name.empty()) + { + last = _initData.stringConverter->toUTF8(ident.name.data(), ident.name.data() + ident.name.size(), + buffer); + name = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); + } buffer.reset(); - last = _initData.stringConverter->toUTF8(ident.category.data(), ident.category.data() + ident.category.size(), - buffer); - category = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); + if(!ident.category.empty()) + { + last = _initData.stringConverter->toUTF8(ident.category.data(), + ident.category.data() + ident.category.size(), buffer); + category = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); + } } if(category.empty()) diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index 09d38acc992..4bd8711b351 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -413,13 +413,16 @@ Ice::PropertiesI::parseLine(const string& line, const StringConverterPtr& conver if(converter) { string tmp; - converter->fromUTF8(reinterpret_cast<const Byte*>(key.data()), + converter->fromUTF8(reinterpret_cast<const Byte*>(key.data()), reinterpret_cast<const Byte*>(key.data() + key.size()), tmp); key.swap(tmp); - converter->fromUTF8(reinterpret_cast<const Byte*>(value.data()), - reinterpret_cast<const Byte*>(value.data() + value.size()), tmp); - value.swap(tmp); + if(!value.empty()) + { + converter->fromUTF8(reinterpret_cast<const Byte*>(value.data()), + reinterpret_cast<const Byte*>(value.data() + value.size()), tmp); + value.swap(tmp); + } } setProperty(key, value); diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index 5ba3c621c12..4c055017f68 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -541,7 +541,7 @@ IceInternal::ReferenceFactory::create(const string& str) throw ex; } - if(_instance->initializationData().stringConverter) + if(_instance->initializationData().stringConverter && !adapter.empty()) { string tmpAdapter; _instance->initializationData().stringConverter->fromUTF8( diff --git a/cpp/src/Ice/StringConverter.cpp b/cpp/src/Ice/StringConverter.cpp index 985111f9aa9..e6b112fd1bc 100755 --- a/cpp/src/Ice/StringConverter.cpp +++ b/cpp/src/Ice/StringConverter.cpp @@ -8,12 +8,49 @@ // ********************************************************************** #include <Ice/StringConverter.h> -#include <IceUtil/Unicode.h> +#include <IceUtil/IceUtil.h> #include <Ice/LocalException.h> using namespace IceUtil; using namespace std; + +#ifdef _WIN32 +namespace +{ +// +// Helper function +// + +string getMessageForLastError() +{ + LPVOID lpMsgBuf = 0; + DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR)&lpMsgBuf, + 0, + NULL); + + string msg; + if(ok) + { + msg = (LPCTSTR)lpMsgBuf; + LocalFree(lpMsgBuf); + } + else + { + msg = "Unknown Windows error"; + } + return msg; +} +} +#endif + + namespace Ice { @@ -64,6 +101,12 @@ void UnicodeWstringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, wstring& target) const { + if(sourceStart == sourceEnd) + { + target = L""; + return; + } + ConversionResult result = convertUTF8ToUTFWstring(sourceStart, sourceEnd, target, lenientConversion); @@ -82,4 +125,88 @@ UnicodeWstringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd } } } + +#ifdef _WIN32 +WindowsStringConverter::WindowsStringConverter(unsigned int cp) : + _cp(cp) +{ +} + +Byte* +WindowsStringConverter::toUTF8(const char* sourceStart, + const char* sourceEnd, + UTF8Buffer& buffer) const +{ + // + // First convert to UTF-16 + // + int sourceSize = sourceEnd - sourceStart; + if(sourceSize == 0) + { + return buffer.getMoreBytes(1, 0); + } + + size_t size = 0; + int writtenWchar = 0; + IceUtil::ScopedArray<wchar_t> wbuffer; + do + { + size = size == 0 ? static_cast<size_t>(sourceSize) + 2 : 2 * size; + wbuffer.reset(new wchar_t[size]); + + writtenWchar = MultiByteToWideChar(_cp, MB_ERR_INVALID_CHARS, sourceStart, + sourceSize, wbuffer.get(), size); + } while(writtenWchar == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER); + + if(writtenWchar == 0) + { + throw StringConversionException(__FILE__, __LINE__, getMessageForLastError()); + } + + // + // Then convert this UTF-16 wbuffer into UTF-8 + // + return _unicodeWstringConverter.toUTF8(wbuffer.get(), wbuffer.get() + writtenWchar, buffer); +} + +void +WindowsStringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, + string& target) const +{ + if(sourceStart == sourceEnd) + { + target = ""; + return; + } + + // + // First convert to wstring (UTF-16) + // + wstring wtarget; + _unicodeWstringConverter.fromUTF8(sourceStart, sourceEnd, wtarget); + + // + // And then to a multi-byte narrow string + // + size_t size = 0; + int writtenChar = 0; + IceUtil::ScopedArray<char> buffer; + do + { + size = size == 0 ? static_cast<size_t>(sourceEnd - sourceStart) + 2 : 2 * size; + buffer.reset(new char[size]); + writtenChar = WideCharToMultiByte(_cp, 0, wtarget.data(), wtarget.size(), + buffer.get(), size, 0, 0); + } while(writtenChar == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER); + + if(writtenChar == 0) + { + throw StringConversionException(__FILE__, __LINE__, getMessageForLastError()); + } + + target.assign(buffer.get(), writtenChar); +} + +#endif + } diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index fde6cf359ad..c222c680cad 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -876,6 +876,12 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const servicesStr += s->name + " "; } props.push_back(createProperty("IceBox.LoadOrder", servicesStr)); + + if(iceBox->adapters.empty() && + getProperty(iceBox->propertySet.properties, "IceBox.ServiceManager.RegisterProcess") != "0") + { + server->processRegistered = true; + } } // diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 27fd7396399..2535bfc7abc 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -1153,7 +1153,13 @@ ServerI::adapterDeactivated(const string& id) ServerCommandPtr command; { Lock sync(*this); - if(_state == Active && _serverLifetimeAdapters.find(id) != _serverLifetimeAdapters.end()) + while(_state == ServerI::Activating) + { + wait(); // Wait for activate() to set the state to WaitForActivation + } + + if((_state == Active || _state == WaitForActivation) && + _serverLifetimeAdapters.find(id) != _serverLifetimeAdapters.end()) { setStateNoSync(Deactivating); } @@ -1440,12 +1446,13 @@ ServerI::deactivate() Ice::ProcessPrx process; { Lock sync(*this); - assert(_desc); if(_state != Deactivating && _state != DeactivatingWaitForProcess) { return; } + assert(_desc); + // // If a process object is supposed to be registered and it's // not set yet, we wait for the server to set this process diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp index 6f306f345de..c0694ec351d 100644 --- a/cpp/src/IceUtil/Thread.cpp +++ b/cpp/src/IceUtil/Thread.cpp @@ -7,6 +7,15 @@ // // ********************************************************************** +#ifdef __sun // +// Solaris 10 bug: it's supposed to be defined in pthread.h +// +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif +#include <limits.h> +#endif + #include <IceUtil/Thread.h> #include <IceUtil/Time.h> #include <IceUtil/ThreadException.h> diff --git a/cpp/test/Ice/Makefile b/cpp/test/Ice/Makefile index 27c6407af4c..2c577b0081e 100644 --- a/cpp/test/Ice/Makefile +++ b/cpp/test/Ice/Makefile @@ -31,7 +31,8 @@ SUBDIRS = proxy \ timeout \ servantLocator \ threads \ - interceptor + interceptor \ + stringConverter $(EVERYTHING):: @for subdir in $(SUBDIRS); \ diff --git a/cpp/test/Ice/Makefile.mak b/cpp/test/Ice/Makefile.mak index 827ec3709d4..dfe04be6621 100644 --- a/cpp/test/Ice/Makefile.mak +++ b/cpp/test/Ice/Makefile.mak @@ -31,7 +31,8 @@ SUBDIRS = proxy \ timeout \ servantLocator \ threads \ - interceptor + interceptor \ + stringConverter $(EVERYTHING):: @for %i in ( $(SUBDIRS) ) do \ diff --git a/cpp/test/Ice/stringConverter/.gitignore b/cpp/test/Ice/stringConverter/.gitignore new file mode 100644 index 00000000000..505a9066685 --- /dev/null +++ b/cpp/test/Ice/stringConverter/.gitignore @@ -0,0 +1,6 @@ +// Generated by makegitignore.py + +// IMPORTANT: Do not edit this file -- any edits made here will be lost! +client +Test.cpp +Test.h diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp index 84351b02a40..8186e64151e 100644 --- a/cpp/test/Ice/stringConverter/Client.cpp +++ b/cpp/test/Ice/stringConverter/Client.cpp @@ -10,8 +10,16 @@ #include <Ice/Ice.h> #include <TestCommon.h> #include <Test.h> + +#if defined(ICONV_ON_WINDOWS) +// +// On Windows, Ice/IcongStringConverter.h is not included by Ice/Ice.h +// #include <Ice/IconvStringConverter.h> +#endif + #include <iostream> +#include <locale.h> using namespace std; @@ -47,21 +55,74 @@ public: } }; +static bool useLocale = false; +static bool useIconv = true; + int main(int argc, char* argv[]) { Client app; - + +#ifndef _WIN32 + // + // Switch to French locale + // (we just used the codeset for as default internal code for + // initData.stringConverter below) + // + + useLocale = (setlocale(LC_ALL, "fr_FR.ISO8859-15") != 0 + || setlocale(LC_ALL, "fr_FR.iso885915@euro") != 0); +#endif + Ice::InitializationData initData; - initData.stringConverter = new Ice::IconvStringConverter<char>("ISO-8859-15"); + +#if defined(_WIN32) && !defined(ICONV_ON_WINDOWS) + // + // 28605 == ISO 8859-15 codepage + // + initData.stringConverter = new Ice::WindowsStringConverter(28605); + useIconv = false; + +#elif defined(__hpux) + if(useLocale) + { + initData.stringConverter = new Ice::IconvStringConverter<char>; + } + else + { + initData.stringConverter = new Ice::IconvStringConverter<char>("iso815"); + } + initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("ucs4"); +#else + + if(useLocale) + { +#ifndef _WIN32 + initData.stringConverter = new Ice::IconvStringConverter<char>; +#endif + } + else + { + initData.stringConverter = new Ice::IconvStringConverter<char>("ISO8859-15"); + } + if(sizeof(wchar_t) == 4) { - initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-32"); +#ifdef ICE_BIG_ENDIAN + initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-32BE"); +#else + initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-32LE"); +#endif } else { - initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-16"); +#ifdef ICE_BIG_ENDIAN + initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-16BE"); +#else + initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-16LE"); +#endif } +#endif return app.main(argc, argv, initData); } @@ -84,12 +145,21 @@ Client::run(int, char*[]) Test::MyObjectPrx clientPrx = Test::MyObjectPrx::uncheckedCast(communicator()->stringToProxy(serverPrx->ice_toString())); - char oe = char(0xBD); // A single character in ISO Latin 9 + char oe = char(0xBD); // A single character in ISO Latin 9 string msg = string("tu me fends le c") + oe + "ur!"; - - cout << "testing iconv string converter..." << flush; + cout << "testing string converter"; + if(useLocale) + { + cout << " (using locale)"; + } + if(useIconv) + { + cout << " (using iconv)"; + } + cout << "..." << flush; wstring wmsg = clientPrx->widen(msg); test(clientPrx->narrow(wmsg) == msg); + test(wmsg.size() == msg.size()); cout << "ok" << endl; // diff --git a/cpp/test/Ice/stringConverter/Makefile.mak b/cpp/test/Ice/stringConverter/Makefile.mak new file mode 100755 index 00000000000..5b266e2c656 --- /dev/null +++ b/cpp/test/Ice/stringConverter/Makefile.mak @@ -0,0 +1,42 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +top_srcdir = ..\..\.. + +CLIENT = client.exe + + +OBJS = Client.obj \ + Test.obj + +SRCS = $(OBJS:.obj=.cpp) + +!include $(top_srcdir)/config/Make.rules.mak + +CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +!if "$(ICONV_HOME)" != "" +CPPFLAGS = $(CPPFLAGS) -I$(ICONV_HOME)\include -DICONV_ON_WINDOWS -DICE_NO_ERRNO +LIBS = $(LIBS) -LIBPATH:$(ICONV_HOME)\lib $(ICONV_LIB) +!endif + +!if "$(CPP_COMPILER)" != "BCC2006" && "$(OPTIMIZE)" != "yes" +PDBFLAGS = /pdb:$(CLIENT:.exe=.pdb) +!endif + +$(CLIENT): $(OBJS) + $(LINK) $(LD_EXEFLAGS) $(PDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBNAME) $(LIBS) + @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ + $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest + +all:: $(CLIENT) + +clean:: + del /q Test.cpp Test.h + +!include .depend diff --git a/cpp/test/Ice/stringConverter/README b/cpp/test/Ice/stringConverter/README new file mode 100755 index 00000000000..f01b64b6035 --- /dev/null +++ b/cpp/test/Ice/stringConverter/README @@ -0,0 +1,13 @@ +This is a test for the string converter implementations. +By default, it uses the Ice::WindowsStringConverter on Windows and the +Ice::IconvStringConverter on other platforms. + +If you want to use iconv on Windows, set ICONV_HOME to your Iconv +installation, and put %ICONV_HOME%\bin in your PATH when running +the test suite. + +The Windows build system assumes that your Iconv DLL uses its own +C runtime library: therefore it's not possible to retrieve Iconv's +errno and we build with -DICE_NO_ERRNO. + +Remove this -DICE_NO_ERRNO if you have a better iconv build. diff --git a/cpp/test/IceGrid/deployer/AllTests.cpp b/cpp/test/IceGrid/deployer/AllTests.cpp index 5a87f264d18..bc728bc3cd1 100644 --- a/cpp/test/IceGrid/deployer/AllTests.cpp +++ b/cpp/test/IceGrid/deployer/AllTests.cpp @@ -747,6 +747,8 @@ allTestsWithTarget(const Ice::CommunicatorPtr& comm) obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox3-Service1@IceBox3.Service1.Service1")); obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox3-Service3@IceBox3.Service3.Service3")); + obj = TestIntfPrx::checkedCast(comm->stringToProxy("IceBox3-Service4@IceBox3.Service4.Service4")); + obj = TestIntfPrx::checkedCast(comm->stringToProxy("Server3@Server3.Server")); test(obj->getProperty("TargetProp") == "1"); |