summaryrefslogtreecommitdiff
path: root/cpp/test/Ice
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-07-18 16:47:05 -0400
committerBernard Normier <bernard@zeroc.com>2007-07-18 16:47:05 -0400
commitd7677e935d836ce91e64af89e78d0c0345a49b7d (patch)
tree51a19a78005a291fd81997ee5e9114edf1b67a12 /cpp/test/Ice
parentMerge branch 'master' of ssh://cvs/home/git/ice (diff)
downloadice-d7677e935d836ce91e64af89e78d0c0345a49b7d.tar.bz2
ice-d7677e935d836ce91e64af89e78d0c0345a49b7d.tar.xz
ice-d7677e935d836ce91e64af89e78d0c0345a49b7d.zip
Added new WindowsStringConverter
Diffstat (limited to 'cpp/test/Ice')
-rw-r--r--cpp/test/Ice/Makefile.mak2
-rw-r--r--cpp/test/Ice/stringConverter/Client.cpp27
-rwxr-xr-xcpp/test/Ice/stringConverter/Makefile.mak8
3 files changed, 29 insertions, 8 deletions
diff --git a/cpp/test/Ice/Makefile.mak b/cpp/test/Ice/Makefile.mak
index 77888312c28..dfe04be6621 100644
--- a/cpp/test/Ice/Makefile.mak
+++ b/cpp/test/Ice/Makefile.mak
@@ -32,9 +32,7 @@ SUBDIRS = proxy \
servantLocator \
threads \
interceptor \
-!if "$(ICONV_HOME)" != ""
stringConverter
-!endif
$(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp
index 795535d6ece..8186e64151e 100644
--- a/cpp/test/Ice/stringConverter/Client.cpp
+++ b/cpp/test/Ice/stringConverter/Client.cpp
@@ -10,7 +10,14 @@
#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>
@@ -49,26 +56,34 @@ 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)
//
-
-#ifndef _WIN32
+
useLocale = (setlocale(LC_ALL, "fr_FR.ISO8859-15") != 0
|| setlocale(LC_ALL, "fr_FR.iso885915@euro") != 0);
#endif
Ice::InitializationData initData;
-#if defined(__hpux)
+#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>;
@@ -132,11 +147,15 @@ Client::run(int, char*[])
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";
+ 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);
diff --git a/cpp/test/Ice/stringConverter/Makefile.mak b/cpp/test/Ice/stringConverter/Makefile.mak
index adf6d97b850..5b266e2c656 100755
--- a/cpp/test/Ice/stringConverter/Makefile.mak
+++ b/cpp/test/Ice/stringConverter/Makefile.mak
@@ -19,14 +19,18 @@ SRCS = $(OBJS:.obj=.cpp)
!include $(top_srcdir)/config/Make.rules.mak
-CPPFLAGS = -I. -I../../include -I$(ICONV_HOME)/include $(CPPFLAGS) -DICE_NO_ERRNO -DWIN32_LEAN_AND_MEAN
+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) /LIBPATH:$(ICONV_HOME)\lib $(ICONV_LIB)
+ $(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