diff -ur omniORB-4.0.0.orig/config/config.mk omniORB-4.0.0/config/config.mk --- omniORB-4.0.0.orig/config/config.mk Thu Jun 21 11:17:17 2001 +++ omniORB-4.0.0/config/config.mk Tue Dec 31 12:47:49 2002 @@ -14,6 +14,7 @@ # x86_nt_3.5 x86 Windows NT 3.5, MS VC++ 5.0 # x86_nt_4.0 x86 Windows NT 4.0, MS VC++ 5.0 # x86_win95 Windows 95, MS VC++ 5.0 +# x86_win32_dmc x86 Win32, Digital Mars C++ (>= 8.32.14) # alpha_nt_4.0 Alpha Windows NT 4.0, MS VC++ 5.0 # alpha_osf1_3.2 Digital Unix 3.2, DEC C++ v5.5 # alpha_osf1_4.0 Digital Unix 4.0, DEC C++ v6.0 @@ -54,6 +55,7 @@ #platform = x86_nt_3.5 #platform = x86_nt_4.0 #platform = x86_win95 +#platform = x86_win32_dmc #platform = alpha_nt_4.0 #platform = alpha_osf1_3.2 #platform = alpha_osf1_4.0 diff -ur omniORB-4.0.0.orig/include/omniORB4/CORBA_sysdep.h omniORB-4.0.0/include/omniORB4/CORBA_sysdep.h --- omniORB-4.0.0.orig/include/omniORB4/CORBA_sysdep.h Mon Feb 18 11:59:12 2002 +++ omniORB-4.0.0/include/omniORB4/CORBA_sysdep.h Tue Dec 31 01:05:48 2002 @@ -197,6 +197,15 @@ // a member function in the base class. # pragma warning(disable: 4250) +#elif defined(__DMC__) +# define NEED_DUMMY_RETURN + +# ifdef _WINSTATIC +# define _OMNIORB_NTDLL_IMPORT +# else +# define _OMNIORB_NTDLL_IMPORT __declspec(dllimport) +# endif + #else // For non-MSVC++ compiler, this macro expands to nothing. diff -ur omniORB-4.0.0.orig/include/omniORB4/CORBA_sysdep_trad.h omniORB-4.0.0/include/omniORB4/CORBA_sysdep_trad.h --- omniORB-4.0.0.orig/include/omniORB4/CORBA_sysdep_trad.h Wed Mar 13 16:05:38 2002 +++ omniORB-4.0.0/include/omniORB4/CORBA_sysdep_trad.h Tue Dec 31 01:05:48 2002 @@ -197,6 +197,23 @@ # define _CORBA_ULONGLONG_DECL unsigned __int64 # define _CORBA_LONGLONG_CONST(x) (x) +#elif defined(__DMC__) +// Digital Mars C++ +# define HAS_Cplusplus_Bool +# define HAS_Cplusplus_Namespace +# define HAS_Std_Namespace + +# define HAVE_STRTOULL + +# define HAS_LongDouble +# define HAS_LongLong +# define _CORBA_LONGDOUBLE_DECL long double +# define _CORBA_LONGLONG_DECL long long +# define _CORBA_ULONGLONG_DECL unsigned long long +# define _CORBA_LONGLONG_CONST(x) (x##LL) + +# define OMNI_REQUIRES_FQ_BASE_CTOR + #elif defined(__BCPLUSPLUS__) # define HAS_Cplusplus_Namespace diff -ur omniORB-4.0.0.orig/include/omniORB4/dynAny.h omniORB-4.0.0/include/omniORB4/dynAny.h --- omniORB-4.0.0.orig/include/omniORB4/dynAny.h Wed Oct 17 16:44:01 2001 +++ omniORB-4.0.0/include/omniORB4/dynAny.h Tue Dec 31 01:05:48 2002 @@ -54,6 +54,12 @@ static _CORBA_Boolean is_nil(_ptr_type); static void release(_ptr_type); static void duplicate(_ptr_type); + +#ifdef __DMC__ + // Digital Mars C++ tries to instantiate a template that needs these + static inline void marshalObjRef(_ptr_type, cdrStream &) { } + static inline _ptr_type unmarshalObjRef(cdrStream &) { return _nil(); } +#endif }; class DynAny : public CORBA::Object { @@ -299,6 +305,12 @@ typedef _CORBA_ConstrType_Variable_Var _var_type; CORBA::String_member id; CORBA::Any value; + +#ifdef __DMC__ + // Digital Mars C++ tries to instantiate a template that needs these + inline void operator >>= (cdrStream &) const { } + inline void operator <<= (const cdrStream &) { } +#endif }; typedef NameValuePair::_var_type NameValuePair_var; @@ -417,6 +429,12 @@ typedef _CORBA_ConstrType_Variable_Var _var_type; CORBA::String_member id; DynAny_member value; + +#ifdef __DMC__ + // Digital Mars C++ tries to instantiate a template that needs these + inline void operator >>= (cdrStream &) const { } + inline void operator <<= (const cdrStream &) { } +#endif }; typedef NameDynAnyPair::_var_type NameDynAnyPair_var; diff -ur omniORB-4.0.0.orig/include/omniORB4/internal/inProcessIdentity.h omniORB-4.0.0/include/omniORB4/internal/inProcessIdentity.h --- omniORB-4.0.0.orig/include/omniORB4/internal/inProcessIdentity.h Tue Nov 27 14:36:17 2001 +++ omniORB-4.0.0/include/omniORB4/internal/inProcessIdentity.h Tue Dec 31 12:36:58 2002 @@ -66,6 +66,9 @@ class omniInProcessIdentity : public omniIdentity { public: + // must be declared before it's used as a default argument for DMC + static void* thisClassCompare(omniIdentity*, void*); + inline ~omniInProcessIdentity() { ASSERT_OMNI_TRACEDMUTEX_HELD(*omni::internalLock, 1); if (--identity_count == 0) @@ -108,8 +111,6 @@ virtual _CORBA_Boolean inThisAddressSpace(); // Override omniIdentity. - - static void* thisClassCompare(omniIdentity*, void*); static inline omniInProcessIdentity* downcast(omniIdentity* id) { diff -ur omniORB-4.0.0.orig/include/omniORB4/internal/localIdentity.h omniORB-4.0.0/include/omniORB4/internal/localIdentity.h --- omniORB-4.0.0.orig/include/omniORB4/internal/localIdentity.h Tue Nov 27 14:36:17 2001 +++ omniORB-4.0.0/include/omniORB4/internal/localIdentity.h Tue Dec 31 12:37:14 2002 @@ -90,6 +90,9 @@ class omniLocalIdentity : public omniIdentity { public: + // must be declared before it's used as a default argument for DMC + static void* thisClassCompare(omniIdentity*, void*); + inline ~omniLocalIdentity() {} inline omniLocalIdentity(omniObjKey& key, @@ -154,8 +157,6 @@ virtual _CORBA_Boolean inThisAddressSpace(); // Override omniIdentity. - - static void* thisClassCompare(omniIdentity*, void*); static inline omniLocalIdentity* downcast(omniIdentity* id) { diff -ur omniORB-4.0.0.orig/include/omniORB4/internal/objectTable.h omniORB-4.0.0/include/omniORB4/internal/objectTable.h --- omniORB-4.0.0.orig/include/omniORB4/internal/objectTable.h Wed Aug 22 13:31:31 2001 +++ omniORB-4.0.0/include/omniORB4/internal/objectTable.h Tue Dec 31 12:37:43 2002 @@ -71,6 +71,9 @@ ALL_STATES = 15 }; + // must be declared before it's used as a default argument for DMC + static void* thisClassCompare(omniIdentity*, void*); + ~omniObjTableEntry(); inline omniObjTableEntry(omniObjKey& key, @@ -177,8 +180,6 @@ // List of objrefs with references to this id. // Must hold - - static void* thisClassCompare(omniIdentity*, void*); static inline omniObjTableEntry* downcast(omniIdentity* id) { diff -ur omniORB-4.0.0.orig/include/omniORB4/internal/remoteIdentity.h omniORB-4.0.0/include/omniORB4/internal/remoteIdentity.h --- omniORB-4.0.0.orig/include/omniORB4/internal/remoteIdentity.h Wed Sep 19 17:26:47 2001 +++ omniORB-4.0.0/include/omniORB4/internal/remoteIdentity.h Tue Dec 31 12:37:35 2002 @@ -75,6 +75,9 @@ class omniRemoteIdentity : public omniIdentity { public: + // must be declared before it's used as a default argument for DMC + static void* thisClassCompare(omniIdentity*, void*); + inline omniRemoteIdentity(omniIOR* ior, const CORBA::Octet* key, CORBA::ULong keysize, @@ -110,8 +113,6 @@ virtual _CORBA_Boolean inThisAddressSpace(); // Override omniIdentity. - - static void* thisClassCompare(omniIdentity*, void*); static inline omniRemoteIdentity* downcast(omniIdentity* id) { diff -ur omniORB-4.0.0.orig/include/omniORB4/linkHacks.h omniORB-4.0.0/include/omniORB4/linkHacks.h --- omniORB-4.0.0.orig/include/omniORB4/linkHacks.h Thu Sep 05 14:29:01 2002 +++ omniORB-4.0.0/include/omniORB4/linkHacks.h Tue Dec 31 16:35:02 2002 @@ -35,7 +35,7 @@ #define OMNI_EXPORT_LINK_FORCE_SYMBOL(modname) \ - int _omni_ ## modname ## _should_be_linked_but_is_not_ + int _omni_ ## modname ## _should_be_linked_but_is_not_ = 0 #define OMNI_FORCE_LINK(modname) \ diff -ur omniORB-4.0.0.orig/mk/platforms/x86_win32_dmc.mk omniORB-4.0.0/mk/platforms/x86_win32_dmc.mk --- omniORB-4.0.0.orig/mk/platforms/x86_win32_dmc.mk Fri Dec 13 18:53:12 2002 +++ omniORB-4.0.0/mk/platforms/x86_win32_dmc.mk Tue Dec 31 16:38:54 2002 @@ -0,0 +1,176 @@ +# +# x86_win32_dmc.mk - make variables and rules specific to Digital Mars C/C++. +# + +WindowsNT = 1 +x86Processor = 1 + +WINVER = 0x0400 + +BINDIR = bin/x86_win32 +LIBDIR = lib/x86_win32 + +ABSTOP = $(shell cd $(TOP); pwd) + +# +# Python set-up +# +# You must set a path to a Python 1.5.2 interpreter. If you do not +# wish to make a complete installation, you may download a minimal +# Python from ftp://ftp.uk.research.att.com/pub/omniORB/python/ +# In that case, uncomment the first line below. + +#PYTHON = $(ABSTOP)/$(BINDIR)/omnipython +#PYTHON = /cygdrive/c/progra~1/Python/python +#PYTHON = c:/Python22/python + + +# +# Include general win32 things +# + +include $(THIS_IMPORT_TREE)/mk/win32.mk + + + +IMPORT_CPPFLAGS += -D__x86__ -D__NT__ -D__OSVERSION__=4 + + +# Default directory for the omniNames log files. +OMNINAMES_LOG_DEFAULT_LOCATION = C:\\temp + + +AR = lib + +CXX = dmc +CXXMAKEDEPEND = omkdepend -D__cplusplus -D__DMC__ +CXXLINK = link +#CXXOPTIONS = -cpp -Ae -g -D_MT -D_STLP_NO_OWN_IOSTREAMS -D_handle=_omni_handle +CXXOPTIONS = -cpp -Ae -ND -D_STLP_NO_OWN_IOSTREAMS -D_handle=_omni_handle +CXXDEBUGFLAGS = + +CXXLINKOPTIONS = -delexecutable + +DMC_DLL_CXXLINKDEBUGOPTIONS = -co +DMC_DLL_CXXLINKNODEBUGOPTIONS = + +CC = dmc +CMAKEDEPEND = omkdepend -D__DMC__ +CLINK = link +COPTIONS = -Jm -o+all +CDEBUGFLAGS = + +CLINKOPTIONS = -delexecutable + +OMNIIDL = $(BASE_OMNI_TREE)/$(WRAPPER_FPATH)/omniidl.exe + + +static/%.o: %.cc + $(CXX) -c -o+all -WA $(CXXFLAGS) -o$@ $< + +debug/%.o: %.cc + $(CXX) -c -g -S -WA $(CXXFLAGS) -o$@ $< + +shared/%DynSK.o: %DynSK.cc + $(CXX) -c -o+all -WD -DUSE_core_stub_in_nt_dll $(CXXFLAGS) -o$@ $< + +shared/%SK.o: %SK.cc + $(CXX) -c -o+all -WD -DUSE_dyn_stub_in_nt_dll $(CXXFLAGS) -o$@ $< + +shared/%.o: %.cc + $(CXX) -c -o+all -WD $(CXXFLAGS) -o$@ $< + +shareddebug/%DynSK.o: %DynSK.cc + $(CXX) -c -g -S -WD -DUSE_core_stub_in_nt_dll $(CXXFLAGS) -o$@ $< + +shareddebug/%SK.o: %SK.cc + $(CXX) -c -g -S -WD -DUSE_dyn_stub_in_nt_dll $(CXXFLAGS) -o$@ $< + +shareddebug/%.o: %.cc + $(CXX) -c -g -S -WD $(CXXFLAGS) -o$@ $< + +%.o: %.c + $(CC) -c $(CFLAGS) -o$@ $< + +%.o: %.cc + $(CXX) -c $(CXXFLAGS) -o$@ $< + + +RPATH = $(subst $(space),;,$(strip $(IMPORT_LIBRARY_DIRS))) + +define CleanRule +$(RM) *.o *.lib +endef + + +define CXXExecutable +(set -x; \ + $(RM) $@; \ + cmd //c $(CXXLINK) $(filter-out $(LibPathPattern),$(CXXLINKOPTIONS)) \ + $(foreach file,$(filter-out $(LibPattern),$^),$(subst /,\\,$(file))), \ + $@, NUL, \ + user32 kernel32 $(patsubst $(LibPattern),%,$$libs) \ +) +endef + +define CExecutable +( set -x; \ + cmd //c $(CLINK) $(filter-out $(LibPathPattern),$(CLINKOPTIONS)) \ + $(filter-out $(LibPattern),$^), \ + $@, NUL, \ + user32 kernel32 $(patsubst $(LibPattern),%,$$libs) \ +) +endef + +define StaticLinkLibrary +(set -x; \ + $(RM) $@; \ + cmd //c $(AR) -c -p256 -n $@ $^; \ +) +endef + +# MakeCXXExportSymbolDefinitionFile +# Internal canned command used by MakeCXXSharedLibrary +# +# - Create a .def file containing all the functions and static class +# variables exported by the DLL. The symbols are extracted from the +# output of libunres. +# +define MakeCXXExportSymbolDefinitionFile +symrefdir=$${debug:+debug}; \ +symreflib=$(SharedLibrarySymbolRefLibraryTemplate); \ +if [ ! -f $$symreflib ]; then echo "Cannot find reference static library $$symreflib"; return 1; fi; \ +set -x; \ +echo "LIBRARY $$libname" > $$defname; \ +echo "VERSION $$version" >> $$defname; \ +echo "EXETYPE NT" >> $$defname; \ +echo "SUBSYSTEM WINDOWS" >> $$defname; \ +echo "CODE SHARED EXECUTE" >> $$defname; \ +echo "DATA WRITE" >> $$defname; \ +echo "EXPORTS" >> $$defname; \ +libunres -d $$symreflib | \ +egrep '^\?[^ ]*|^\?[^?][^ ]*' | fgrep -v "%" >> $$defname; \ +set +x; +endef + +define MakeCXXSharedLibrary +$(ParseNameSpec); \ +extrasuffix=$${debug:+d}; \ +targetdir=$(@D); \ +libname=$(SharedLibraryLibNameTemplate); \ +dllname=$$targetdir\\$$libname.dll; \ +defname=$$targetdir\\$(SharedLibraryExportSymbolFileNameTemplate); \ +version=$(SharedLibraryVersionStringTemplate); \ +if [ -n "$$debug" ]; then \ +extralinkoption="$(DMC_DLL_CXXLINKDEBUGOPTIONS)"; \ +else \ +extralinkoption="$(DMC_DLL_CXXLINKNODEBUGOPTIONS)"; \ +fi; \ +$(MakeCXXExportSymbolDefinitionFile) \ +set -x; \ +$(RM) $@; \ +cmd //c $(CXXLINK) $(filter-out $(LibPathPattern),$(CXXLINKOPTIONS)) $$extralinkoption \ + $(subst /,\\,$^) , $$dllname ,, \ + $${extralibs/\//\\} user32 kernel32 , $$defname; \ +implib $$targetdir\\$$libname $$dllname; +endef diff -ur omniORB-4.0.0.orig/readmes/README.dmc omniORB-4.0.0/readmes/README.dmc --- omniORB-4.0.0.orig/readmes/README.dmc Tue Dec 31 03:48:03 2002 +++ omniORB-4.0.0/readmes/README.dmc Tue Dec 31 12:43:39 2002 @@ -0,0 +1,35 @@ +You need at least Digital Mars C++ 8.32.14 (earlier versions won't +work). + +Some notes about compiling with DM: + + * Use "platform = x86_win32_dmc" in config\config.mak + + * x86_win32_dmc.mk uses "-ND" to link with DM's DLL runtime library + (which isn't included in the download version of the compiler), if + you want to link with the static version of the runtime library you + have to replace "-ND" with "-D_MT". + + * You can use the Python DLL included in Python binary distributions, + but you have to create a Python import library for DM using "implib + /system python22.lib python22.dll" and copy the import library to + src\tool\omniidl\cxx\ + + * I am using the MSYS (see http://www.mingw.org/msys.shtml) versions + of the GNU tools - for using the Cygwin tools or some other Win32 + port of the GNU tools, minor changes to x86_win32_dmc.mk might be + necessary. In particular, DM's "link" and "lib" commands can't be + directly invoked from MSYS's make/sh, therefore these commands are + indirectly invoked via "cmd //c" (if that doesn't work for you, you + can try replacing it with "cmd /c" or completely removing the "cmd + //c" part). + + * DM's link sometimes complains about unknown "libpath" options + (these can safely be ignored) - the build system currently assumes + that MSVC++ is used on Windows + + * I get an "out of memory" error when trying to compile + src\services\mklib\CosNotifyChannelAdminSK.cc with debug + information + + * I haven't done much testing yet (omniNames does at least start up) diff -ur omniORB-4.0.0.orig/src/appl/omniNames/log.cc omniORB-4.0.0/src/appl/omniNames/log.cc --- omniORB-4.0.0.orig/src/appl/omniNames/log.cc Tue Jan 15 16:38:10 2002 +++ omniORB-4.0.0/src/appl/omniNames/log.cc Tue Dec 31 02:02:53 2002 @@ -70,6 +70,9 @@ #elif defined(__GNUG__) && __GNUG__ >= 3 # define USE_STREAM_OPEN # define OPEN(name,mode,perm) open(name,mode) +#elif defined(__DMC__) +# define USE_STREAM_OPEN +# define OPEN(name,mode,perm) open(name,mode,perm) #endif #ifndef HAVE_STRDUP diff -ur omniORB-4.0.0.orig/src/lib/omniORB/codesets/dir.mk omniORB-4.0.0/src/lib/omniORB/codesets/dir.mk --- omniORB-4.0.0.orig/src/lib/omniORB/codesets/dir.mk Mon Feb 18 11:59:14 2002 +++ omniORB-4.0.0/src/lib/omniORB/codesets/dir.mk Tue Dec 31 01:05:48 2002 @@ -26,7 +26,7 @@ endif ifdef Win32Platform - DIR_CPPFLAGS += -D "NTArchitecture" + DIR_CPPFLAGS += -D"NTArchitecture" vpath %.cc $(VPATH):$(VPATH:%=%/../orbcore) SHARED_ONLY_OBJS = msvcdllstub.o EXTRA_LIBS = wsock32.lib advapi32.lib diff -ur omniORB-4.0.0.orig/src/lib/omniORB/codesets/omniCodeSets.cc omniORB-4.0.0/src/lib/omniORB/codesets/omniCodeSets.cc --- omniORB-4.0.0.orig/src/lib/omniORB/codesets/omniCodeSets.cc Thu Jul 26 16:37:20 2001 +++ omniORB-4.0.0/src/lib/omniORB/codesets/omniCodeSets.cc Tue Dec 31 01:05:48 2002 @@ -28,6 +28,15 @@ #include +#if defined(__DMC__) && defined(_WINDLL) +#include + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + return TRUE; +} +#endif + OMNI_FORCE_LINK(CS_8859_2); OMNI_FORCE_LINK(CS_8859_3); OMNI_FORCE_LINK(CS_8859_4); diff -ur omniORB-4.0.0.orig/src/lib/omniORB/dynamic/dir.mk omniORB-4.0.0/src/lib/omniORB/dynamic/dir.mk --- omniORB-4.0.0.orig/src/lib/omniORB/dynamic/dir.mk Mon Feb 18 11:59:14 2002 +++ omniORB-4.0.0/src/lib/omniORB/dynamic/dir.mk Tue Dec 31 01:05:49 2002 @@ -50,7 +50,7 @@ endif ifdef Win32Platform - DIR_CPPFLAGS += -D "NTArchitecture" + DIR_CPPFLAGS += -D"NTArchitecture" EXTRA_LIBS = $(SOCKET_LIB) advapi32.lib MSVC_STATICLIB_CXXNODEBUGFLAGS += -D_WINSTATIC MSVC_STATICLIB_CXXDEBUGFLAGS += -D_WINSTATIC diff -ur omniORB-4.0.0.orig/src/lib/omniORB/dynamic/dynamicLib.cc omniORB-4.0.0/src/lib/omniORB/dynamic/dynamicLib.cc --- omniORB-4.0.0.orig/src/lib/omniORB/dynamic/dynamicLib.cc Tue Nov 27 14:35:08 2001 +++ omniORB-4.0.0/src/lib/omniORB/dynamic/dynamicLib.cc Tue Dec 31 01:05:49 2002 @@ -68,6 +68,14 @@ #include #include + +#if defined(__DMC__) && defined(_WINDLL) +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + return TRUE; +} +#endif + OMNI_EXPORT_LINK_FORCE_SYMBOL(dynamicLib); OMNI_NAMESPACE_BEGIN(omni) diff -ur omniORB-4.0.0.orig/src/lib/omniORB/dynamic/dynAny.cc omniORB-4.0.0/src/lib/omniORB/dynamic/dynAny.cc --- omniORB-4.0.0.orig/src/lib/omniORB/dynamic/dynAny.cc Mon Feb 11 14:46:20 2002 +++ omniORB-4.0.0/src/lib/omniORB/dynamic/dynAny.cc Tue Dec 31 01:05:49 2002 @@ -4853,7 +4853,7 @@ } DynamicAny::DynAny_ptr -DynAnyFactoryImpl::create_dyn_any_from_type_code(const CORBA::TypeCode_ptr t) +DynAnyFactoryImpl::create_dyn_any_from_type_code(CORBA::TypeCode_ptr t) { return factory_create_dyn_any_from_type_code(t); } diff -ur omniORB-4.0.0.orig/src/lib/omniORB/dynamic/dynAnyNil.cc omniORB-4.0.0/src/lib/omniORB/dynamic/dynAnyNil.cc --- omniORB-4.0.0.orig/src/lib/omniORB/dynamic/dynAnyNil.cc Wed Jan 16 11:31:56 2002 +++ omniORB-4.0.0/src/lib/omniORB/dynamic/dynAnyNil.cc Tue Dec 31 12:45:58 2002 @@ -381,7 +381,8 @@ /////////////////////////// omniNilDynFixed ////////////////////////// ////////////////////////////////////////////////////////////////////// -class omniNilDynFixed : public DynamicAny::DynFixed, public omniNilDynAny { +// DMC gets confused if the base classes are specified in the "wrong" order +class omniNilDynFixed : public omniNilDynAny, public DynamicAny::DynFixed { public: omniNilDynFixed() : OMNIORB_BASE_CTOR(DynamicAny::)DynAny(1) {} @@ -430,7 +431,8 @@ /////////////////////////// omniNilDynEnum /////////////////////////// ////////////////////////////////////////////////////////////////////// -class omniNilDynEnum : public DynamicAny::DynEnum, public omniNilDynAny { +// DMC gets confused if the base classes are specified in the "wrong" order +class omniNilDynEnum : public omniNilDynAny, public DynamicAny::DynEnum { public: omniNilDynEnum() : OMNIORB_BASE_CTOR(DynamicAny::)DynAny(1) {} @@ -485,7 +487,8 @@ ////////////////////////// omniNilDynStruct ////////////////////////// ////////////////////////////////////////////////////////////////////// -class omniNilDynStruct : public DynamicAny::DynStruct, public omniNilDynAny { +// DMC gets confused if the base classes are specified in the "wrong" order +class omniNilDynStruct : public omniNilDynAny, public DynamicAny::DynStruct { public: omniNilDynStruct() : OMNIORB_BASE_CTOR(DynamicAny::)DynAny(1) {} @@ -548,7 +551,8 @@ /////////////////////////// omniNilDynUnion ////////////////////////// ////////////////////////////////////////////////////////////////////// -class omniNilDynUnion : public DynamicAny::DynUnion, public omniNilDynAny { +// DMC gets confused if the base classes are specified in the "wrong" order +class omniNilDynUnion : public omniNilDynAny, public DynamicAny::DynUnion { public: omniNilDynUnion() : OMNIORB_BASE_CTOR(DynamicAny::)DynAny(1) {} @@ -626,7 +630,8 @@ ///////////////////////// omniNilDynSequence ///////////////////////// ////////////////////////////////////////////////////////////////////// -class omniNilDynSequence : public DynamicAny::DynSequence, public omniNilDynAny { +// DMC gets confused if the base classes are specified in the "wrong" order +class omniNilDynSequence : public omniNilDynAny, public DynamicAny::DynSequence { public: omniNilDynSequence() : OMNIORB_BASE_CTOR(DynamicAny::)DynAny(1) {} @@ -688,7 +693,8 @@ /////////////////////////// omniNilDynArray ////////////////////////// ////////////////////////////////////////////////////////////////////// -class omniNilDynArray : public DynamicAny::DynArray, public omniNilDynAny { +// DMC gets confused if the base classes are specified in the "wrong" order +class omniNilDynArray : public omniNilDynAny, public DynamicAny::DynArray { public: omniNilDynArray() : OMNIORB_BASE_CTOR(DynamicAny::)DynAny(1) {} diff -ur omniORB-4.0.0.orig/src/lib/omniORB/orbcore/dir.mk omniORB-4.0.0/src/lib/omniORB/orbcore/dir.mk --- omniORB-4.0.0.orig/src/lib/omniORB/orbcore/dir.mk Wed Aug 21 06:23:15 2002 +++ omniORB-4.0.0/src/lib/omniORB/orbcore/dir.mk Tue Dec 31 01:05:49 2002 @@ -149,7 +149,7 @@ endif ifdef Win32Platform - DIR_CPPFLAGS += -D "NTArchitecture" + DIR_CPPFLAGS += -D"NTArchitecture" EXTRA_LIBS = $(SOCKET_LIB) advapi32.lib SHARED_ONLY_OBJS = msvcdllstub.o MSVC_STATICLIB_CXXNODEBUGFLAGS += -D_WINSTATIC diff -ur omniORB-4.0.0.orig/src/lib/omniORB/orbcore/omniInternal.cc omniORB-4.0.0/src/lib/omniORB/orbcore/omniInternal.cc --- omniORB-4.0.0.orig/src/lib/omniORB/orbcore/omniInternal.cc Sun Sep 08 21:12:39 2002 +++ omniORB-4.0.0/src/lib/omniORB/orbcore/omniInternal.cc Tue Dec 31 02:31:43 2002 @@ -261,7 +261,9 @@ //////////////////////////////////////////////////////////////////////////// #if defined(HAS_Cplusplus_Namespace) +#ifndef __DMC__ using omniORB::operator==; +#endif #endif diff -ur omniORB-4.0.0.orig/src/lib/omniORB/orbcore/omniORB.cc omniORB-4.0.0/src/lib/omniORB/orbcore/omniORB.cc --- omniORB-4.0.0.orig/src/lib/omniORB/orbcore/omniORB.cc Wed Sep 12 19:42:36 2001 +++ omniORB-4.0.0/src/lib/omniORB/orbcore/omniORB.cc Tue Dec 31 01:05:49 2002 @@ -96,6 +96,14 @@ OMNI_USING_NAMESPACE(omni) +#if defined(__DMC__) && defined(_WINDLL) +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + return TRUE; +} +#endif + + ////////////////////////////////////////////////////////////////////// /////////////////////// omniORB::fatalException ////////////////////// ////////////////////////////////////////////////////////////////////// diff -ur omniORB-4.0.0.orig/src/lib/omnithread/nt.cc omniORB-4.0.0/src/lib/omnithread/nt.cc --- omniORB-4.0.0.orig/src/lib/omnithread/nt.cc Sun Aug 18 14:59:16 2002 +++ omniORB-4.0.0/src/lib/omnithread/nt.cc Tue Dec 31 01:05:49 2002 @@ -35,6 +35,14 @@ static void get_time_now(unsigned long* abs_sec, unsigned long* abs_nsec); +#if defined(__DMC__) && defined(_WINDLL) +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + return TRUE; +} +#endif + + /////////////////////////////////////////////////////////////////////////// // // Mutex diff -ur omniORB-4.0.0.orig/src/tool/omniidl/cxx/cccp/alloca.c omniORB-4.0.0/src/tool/omniidl/cxx/cccp/alloca.c --- omniORB-4.0.0.orig/src/tool/omniidl/cxx/cccp/alloca.c Tue Jul 04 15:22:38 2000 +++ omniORB-4.0.0/src/tool/omniidl/cxx/cccp/alloca.c Tue Dec 31 01:05:49 2002 @@ -67,7 +67,7 @@ #define ADDRESS_FUNCTION(arg) &(arg) #endif -#if __STDC__ +#if defined(__STDC__) || defined(__DMC__) typedef void *pointer; #else typedef char *pointer; diff -ur omniORB-4.0.0.orig/src/tool/omniidl/cxx/idlpython.cc omniORB-4.0.0/src/tool/omniidl/cxx/idlpython.cc --- omniORB-4.0.0.orig/src/tool/omniidl/cxx/idlpython.cc Sat Sep 21 21:07:48 2002 +++ omniORB-4.0.0/src/tool/omniidl/cxx/idlpython.cc Tue Dec 31 01:05:49 2002 @@ -1339,18 +1339,39 @@ extern "C" { static PyObject* IdlPyCompile(PyObject* self, PyObject* args) { - PyObject* pyfile; + PyObject *arg; + const char* name; + FILE* file; + IDL_Boolean to_close = 0; - if (!PyArg_ParseTuple(args, (char*)"O!", &PyFile_Type, &pyfile)) + if (!PyArg_ParseTuple(args, (char*)"O", &arg)) return 0; - FILE* file = PyFile_AsFile(pyfile); - PyObject* pyname = PyFile_Name(pyfile); - const char* name = PyString_AsString(pyname); + if (PyString_Check(arg)) { + name = PyString_AsString(arg); + file = fopen(name, "r"); + if (!file) { + PyErr_SetString(PyExc_IOError, + (char*)"Cannot open file"); + return 0; + } + to_close = 1; + } + else if (PyFile_Check(arg)) { + PyObject* pyname = PyFile_Name(arg); + file = PyFile_AsFile(arg); + name = PyString_AsString(pyname); + } + else { + PyErr_SetString(PyExc_TypeError, + (char*)"Argument must be a file or filename"); + return 0; + } IDL_Boolean success = AST::process(file, name); - PyObject* result; + if (to_close) + fclose(file); if (success) { PythonVisitor v; @@ -1376,17 +1397,40 @@ static PyObject* IdlPyDump(PyObject* self, PyObject* args) { - PyObject* pyfile; + PyObject* arg; + const char* name; + FILE* file; + IDL_Boolean to_close = 0; - if (!PyArg_ParseTuple(args, (char*)"O!", &PyFile_Type, &pyfile)) + if (!PyArg_ParseTuple(args, (char*)"O", &arg)) return 0; - FILE* file = PyFile_AsFile(pyfile); - PyObject* pyname = PyFile_Name(pyfile); - const char* name = PyString_AsString(pyname); + if (PyString_Check(arg)) { + name = PyString_AsString(arg); + file = fopen(name, "r"); + if (!file) { + PyErr_SetString(PyExc_IOError, + (char*)"Cannot open file"); + return 0; + } + to_close = 1; + } + else if (PyFile_Check(arg)) { + PyObject* pyname = PyFile_Name(arg); + file = PyFile_AsFile(arg); + name = PyString_AsString(pyname); + } + else { + PyErr_SetString(PyExc_TypeError, + (char*)"Argument must be a file or filename"); + return 0; + } IDL_Boolean success = AST::process(file, name); + if (to_close) + fclose(file); + if (success) { DumpVisitor v; AST::tree()->accept(v); @@ -1516,6 +1560,16 @@ return l; } +static PyObject* IdlPyAlwaysTempFile(PyObject* self, PyObject* args) +{ + if (!PyArg_ParseTuple(args, (char*)"")) return 0; +#if (defined (_MSC_VER) && _MSC_VER > 1200) || defined(__DMC__) + return PyInt_FromLong(1); +#else + return PyInt_FromLong(0); +#endif +} + static PyMethodDef omniidl_methods[] = { {(char*)"compile", IdlPyCompile, METH_VARARGS}, {(char*)"clear", IdlPyClear, METH_VARARGS}, @@ -1527,6 +1581,7 @@ {(char*)"runInteractiveLoop", IdlPyRunInteractiveLoop, METH_VARARGS}, {(char*)"caseSensitive", IdlPyCaseSensitive, METH_VARARGS}, {(char*)"platformDefines", IdlPyPlatformDefines, METH_VARARGS}, + {(char*)"alwaysTempFile", IdlPyAlwaysTempFile, METH_VARARGS}, {NULL, NULL} }; diff -ur omniORB-4.0.0.orig/src/tool/omniidl/cxx/idlutil.cc omniORB-4.0.0/src/tool/omniidl/cxx/idlutil.cc --- omniORB-4.0.0.orig/src/tool/omniidl/cxx/idlutil.cc Tue Jan 15 16:38:14 2002 +++ omniORB-4.0.0/src/tool/omniidl/cxx/idlutil.cc Tue Dec 31 01:05:49 2002 @@ -134,7 +134,7 @@ #ifdef HAS_LongLong -# if defined(__WIN32__) +# if defined(_MSC_VER) IdlIntLiteral idl_strtoul(const char* text, int base) diff -ur omniORB-4.0.0.orig/src/tool/omniidl/python/omniidl/main.py omniORB-4.0.0/src/tool/omniidl/python/omniidl/main.py --- omniORB-4.0.0.orig/src/tool/omniidl/python/omniidl/main.py Wed Jun 05 22:26:32 2002 +++ omniORB-4.0.0/src/tool/omniidl/python/omniidl/main.py Tue Dec 31 01:05:49 2002 @@ -86,6 +86,8 @@ cmdname = "omniidl" +StringType = type("") + def version(): print "omniidl version 1.0" @@ -288,12 +290,7 @@ interactive = 1 elif o == "-T": - try: - import tempfile - temp_file = tempfile.mktemp(".idl") - except ImportError: - # No tempfile module. Just use current directory and hope... - temp_file = "omniidl-tmp" + `os.getpid()` + ".idl" + temp_file = genTempFileName() elif o == "-P": preprocessor_args.extend(_omniidl.platformDefines()) @@ -303,6 +300,15 @@ return files +def genTempFileName(): + try: + import tempfile + return tempfile.mktemp(".idl") + except ImportError: + # No tempfile module. Just use current directory and hope... + return "omniidl-tmp" + `os.getpid()` + ".idl" + + def my_import(name): mod = __import__(name) components = string.split(name, ".") @@ -324,12 +330,15 @@ def main(argv=None): global preprocessor_args, preprocessor_only, preprocessor_cmd global no_preprocessor, backend, backend_args, dump_only, cd_to - global verbose, quiet, print_usage, interactive + global verbose, quiet, print_usage, interactive, temp_file if argv is None: argv = sys.argv files = parseArgs(argv[1:]) + if _omniidl.alwaysTempFile(): + temp_file = genTempFileName() + if print_usage: usage() @@ -382,24 +391,24 @@ sys.stderr.write(cmdname + ": Warning: No back-ends specified; " \ "checking IDL for validity\n") - for file in files: - if file != "-" and not os.path.isfile(file): + for name in files: + if name != "-" and not os.path.isfile(name): if not quiet: - sys.stderr.write(cmdname + ": '" + file + "' does not exist\n") + sys.stderr.write(cmdname + ": '" + name + "' does not exist\n") sys.exit(1) if sys.platform != 'OpenVMS' or len(preprocessor_args)==0: preproc_cmd = '%s %s "%s"' % (preprocessor_cmd, string.join(preprocessor_args, ' '), - file) + name) else: preproc_cmd = '%s "%s" %s' % (preprocessor_cmd, string.join(preprocessor_args,'" "'), - file) + name) if not no_preprocessor: if verbose: sys.stderr.write(cmdname + ": Preprocessing '" +\ - file + "' with '" + preproc_cmd + "'\n") + name + "' with '" + preproc_cmd + "'\n") if preprocessor_only: err = os.system(preproc_cmd) @@ -425,13 +434,13 @@ except: pass sys.exit(1) - file = open(temp_file, "r") + file = temp_file else: file = os.popen(preproc_cmd, "r") else: # No preprocessor - file = open(file, "r") + file = name if verbose: sys.stderr.write(cmdname + ": Running front end\n") @@ -439,16 +448,18 @@ if verbose: sys.stderr.write(cmdname + ": Dumping\n") _omniidl.dump(file) - file.close() + if not isinstance(file, StringType): + file.close() if temp_file: os.remove(temp_file) else: tree = _omniidl.compile(file) - if file.close(): - if not quiet: - sys.stderr.write(cmdname + \ - ": Error running preprocessor\n") - sys.exit(1) + if not isinstance(file, StringType): + if file.close(): + if not quiet: + sys.stderr.write(cmdname + \ + ": Error running preprocessor\n") + sys.exit(1) if tree is None: sys.exit(1)