diff --git a/mozilla/modules/libimg/png/pngconf.h b/mozilla/modules/libimg/png/pngconf.h index 325d2de17f1..a6c2c75ec4f 100644 --- a/mozilla/modules/libimg/png/pngconf.h +++ b/mozilla/modules/libimg/png/pngconf.h @@ -1262,8 +1262,15 @@ typedef z_stream FAR * png_zstreamp; # endif # endif /* PNG_IMPEXP */ #else /* !(DLL || non-cygwin WINDOWS) */ -# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) -# ifndef PNGAPI +# if defined(__OS2__) +# if defined(__GNUC__) && defined(__declspec) && defined(PNG_DLL) && !defined(PNG_IMPEXP) +# ifdef PNG_BUILD_DLL +# define PNG_IMPEXP __declspec(dllexport) +# else +# define PNG_IMPEXP __declspec(dllimport) +# endif +# endif /* GNUC & declspec */ +# if (defined(__IBMC__) || defined(__IBMCPP__)) && !defined(PNGAPI) # define PNGAPI _System # endif # else diff --git a/mozilla/modules/libjar/zipstub.h b/mozilla/modules/libjar/zipstub.h index 8b54005f6cd..78f6add0738 100644 --- a/mozilla/modules/libjar/zipstub.h +++ b/mozilla/modules/libjar/zipstub.h @@ -78,6 +78,9 @@ #elif defined(XP_WIN) #define PR_EXTERN(__type) extern _declspec(dllexport) __type #define PR_PUBLIC_API(__type) _declspec(dllexport) __type +#elif defined(XP_OS2) && defined(__declspec) +#define PR_EXTERN(__type) extern __declspec(dllexport) __type +#define PR_PUBLIC_API(__type) __declspec(dllexport) __type #else /* XP_UNIX */ #define PR_EXTERN(__type) extern __type #define PR_PUBLIC_API(__type) __type diff --git a/mozilla/modules/libreg/include/NSReg.h b/mozilla/modules/libreg/include/NSReg.h index 9b606ffd116..f26a917eae8 100644 --- a/mozilla/modules/libreg/include/NSReg.h +++ b/mozilla/modules/libreg/include/NSReg.h @@ -127,6 +127,8 @@ typedef struct _reginfo #else #define VR_INTERFACE(type) type _far _pascal _export #endif +#elif defined(XP_OS2) && defined(__declspec) + #define VR_INTERFACE(type) __declspec(dllexport) type #elif defined XP_MAC #define VR_INTERFACE(__x) __declspec(export) __x #elif defined (HAVE_VISIBILITY_ATTRIBUTE) diff --git a/mozilla/modules/zlib/src/Makefile.in b/mozilla/modules/zlib/src/Makefile.in index bf0c0f53737..7f6f7b5f847 100644 --- a/mozilla/modules/zlib/src/Makefile.in +++ b/mozilla/modules/zlib/src/Makefile.in @@ -60,7 +60,7 @@ endif endif endif -ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) +ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH))) DEFINES += -DZLIB_DLL=1 endif diff --git a/mozilla/modules/zlib/src/zconf.h b/mozilla/modules/zlib/src/zconf.h index dd32fec122d..eda0459ec85 100644 --- a/mozilla/modules/zlib/src/zconf.h +++ b/mozilla/modules/zlib/src/zconf.h @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: zconf.h,v 3.9 2005-08-04 19:14:14 tor%cs.brown.edu Exp $ */ +/* @(#) $Id: zconf.h,v 3.10 2006-03-08 19:21:35 mkaply%us.ibm.com Exp $ */ #ifndef ZCONF_H #define ZCONF_H @@ -234,6 +234,18 @@ # endif #endif +#if defined(__OS2__) && defined(__declspec) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + #if defined (__BEOS__) # ifdef ZLIB_DLL # ifdef ZLIB_INTERNAL diff --git a/mozilla/sun-java/stubs/include/jni_md.h b/mozilla/sun-java/stubs/include/jni_md.h index 3c8c63d9913..cf6eb8cf327 100644 --- a/mozilla/sun-java/stubs/include/jni_md.h +++ b/mozilla/sun-java/stubs/include/jni_md.h @@ -98,20 +98,8 @@ ******************************************************************************/ /* DLL Entry modifiers... */ -#if defined(XP_OS2) -# ifdef XP_OS2_VACPP -# define JNI_PUBLIC_API(ResultType) ResultType _System -# define JNI_PUBLIC_VAR(VarType) VarType -# define JNICALL _Optlink -# define JNIEXPORT -# else -# define JNI_PUBLIC_API(ResultType) ResultType -# define JNI_PUBLIC_VAR(VarType) VarType -# define JNICALL -# define JNIEXPORT -# endif /* Win32 */ -#elif defined(XP_WIN) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32) +#if defined(XP_WIN) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32) # include # if defined(_MSC_VER) || defined(__GNUC__) # if defined(WIN32) || defined(_WIN32) @@ -153,6 +141,28 @@ /* This is the stuff inherited from JavaSoft .. */ # define JNIEXPORT __declspec(dllexport) +/* OS/2 */ +#elif defined(XP_OS2) +# ifdef XP_OS2_VACPP +# define JNI_PUBLIC_API(ResultType) ResultType _System +# define JNI_PUBLIC_VAR(VarType) VarType +# define JNICALL _Optlink +# define JNIEXPORT +# elif defined(__declspec) +# define JNI_PUBLIC_API(ResultType) __declspec(dllexport) ResultType +# define JNI_PUBLIC_VAR(VarType) VarType +# define JNI_NATIVE_STUB(ResultType) __declspec(dllexport) ResultType +# define JNICALL +# define JNIEXPORT +# else +# define JNI_PUBLIC_API(ResultType) ResultType +# define JNI_PUBLIC_VAR(VarType) VarType +# define JNICALL +# define JNIEXPORT +# endif +# ifndef IS_LITTLE_ENDIAN +# define IS_LITTLE_ENDIAN +# endif /* Mac */ #elif macintosh || Macintosh || THINK_C diff --git a/mozilla/sun-java/stubs/include/jri_md.h b/mozilla/sun-java/stubs/include/jri_md.h index 2514ec29036..950481de35b 100644 --- a/mozilla/sun-java/stubs/include/jri_md.h +++ b/mozilla/sun-java/stubs/include/jri_md.h @@ -68,18 +68,8 @@ extern "C" { /* DLL Entry modifiers... */ -/* PC */ -#if defined(XP_OS2) -# ifdef XP_OS2_VACPP -# define JRI_PUBLIC_API(ResultType) ResultType _Optlink -# define JRI_PUBLIC_VAR(VarType) VarType -# define JRI_CALLBACK -# else -# define JRI_PUBLIC_API(ResultType) ResultType -# define JRI_PUBLIC_VAR(VarType) VarType -# define JRI_CALLBACK -# endif -#elif defined(XP_WIN) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32) +/* Windows */ +#if defined(XP_WIN) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32) # include # if defined(_MSC_VER) || defined(__GNUC__) # if defined(WIN32) || defined(_WIN32) @@ -129,6 +119,25 @@ extern "C" { # define IS_LITTLE_ENDIAN # endif +/* OS/2 */ +#elif defined(XP_OS2) +# ifdef XP_OS2_VACPP +# define JRI_PUBLIC_API(ResultType) ResultType _Optlink +# define JRI_PUBLIC_VAR(VarType) VarType +# define JRI_CALLBACK +# elif defined(__declspec) +# define JRI_PUBLIC_API(ResultType) __declspec(dllexport) ResultType +# define JRI_PUBLIC_VAR(VarType) VarType +# define JRI_PUBLIC_VAR_EXP(VarType) __declspec(dllexport) VarType +# define JRI_PUBLIC_VAR_IMP(VarType) __declspec(dllimport) VarType +# define JRI_NATIVE_STUB(ResultType) __declspec(dllexport) ResultType +# define JRI_CALLBACK +# else +# define JRI_PUBLIC_API(ResultType) ResultType +# define JRI_PUBLIC_VAR(VarType) VarType +# define JRI_CALLBACK +# endif + /* Mac */ #elif defined (macintosh) || Macintosh || THINK_C # if defined(__MWERKS__) /* Metrowerks */ diff --git a/mozilla/toolkit/library/Makefile.in b/mozilla/toolkit/library/Makefile.in index e0b3c2bf171..b01b48cd738 100644 --- a/mozilla/toolkit/library/Makefile.in +++ b/mozilla/toolkit/library/Makefile.in @@ -68,6 +68,10 @@ ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_) CPPSRCS += dlldeps-xul.cpp endif +ifeq ($(OS_ARCH),OS2) +CPPSRCS += dlldeps-xul.cpp +endif + # dependent libraries STATIC_LIBS = \ xulapp_s \ diff --git a/mozilla/toolkit/library/libxul-config.mk b/mozilla/toolkit/library/libxul-config.mk index a39aff83047..9cfdeb64e89 100644 --- a/mozilla/toolkit/library/libxul-config.mk +++ b/mozilla/toolkit/library/libxul-config.mk @@ -60,10 +60,27 @@ endif LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/windows endif -ifeq ($(OS_ARCH),WINNT) +ifneq (,$(filter WINNT OS2,$(OS_ARCH))) DEFINES += -DZLIB_DLL=1 endif +ifeq ($(OS_ARCH),OS2) +REQUIRES += libreg widget gfx + +CPPSRCS += \ + dlldeps.cpp \ + dlldeps-obs.cpp \ + nsGFXDeps.cpp \ + $(NULL) + +ifndef MOZ_NATIVE_ZLIB +CPPSRCS += dlldeps-zlib.cpp +DEFINES += -DZLIB_INTERNAL +endif + +LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/os2 +endif + # dependent libraries STATIC_LIBS += \ xpcom_core \ diff --git a/mozilla/xpcom/build/Makefile.in b/mozilla/xpcom/build/Makefile.in index 08e3a788d2b..dee18bd674d 100644 --- a/mozilla/xpcom/build/Makefile.in +++ b/mozilla/xpcom/build/Makefile.in @@ -92,6 +92,12 @@ CPPSRCS += dlldeps.cpp endif endif +ifndef MINIMO +ifeq ($(OS_ARCH)$(MOZ_ENABLE_LIBXUL),OS2) +CPPSRCS += dlldeps.cpp +endif +endif + ifdef XPCOM_USE_LEA CSRCS += malloc.c endif diff --git a/mozilla/xpcom/build/dlldeps.cpp b/mozilla/xpcom/build/dlldeps.cpp index 812b7ec8af2..9f438c1b899 100644 --- a/mozilla/xpcom/build/dlldeps.cpp +++ b/mozilla/xpcom/build/dlldeps.cpp @@ -38,7 +38,9 @@ // Force references to all of the symbols that we want exported from // the dll that are located in the .lib files we link with +#ifndef XP_OS2 #include +#endif #include "nsXPCOMGlue.h" #include "nsVoidArray.h" #include "nsValueArray.h" @@ -95,7 +97,7 @@ #include "nsStringBuffer.h" #include "nsCategoryCache.h" -#ifndef WINCE +#if !defined(WINCE) && !defined(XP_OS2) #include "nsWindowsRegKey.h" #endif @@ -152,7 +154,7 @@ void XXXNeverCalled() NS_ProxyRelease(nsnull, nsnull, PR_FALSE); XPT_DoString(nsnull, nsnull, nsnull); XPT_DoHeader(nsnull, nsnull, nsnull); -#if defined (DEBUG) && !defined (WINCE) +#if defined (DEBUG) && !defined (WINCE) && !defined(XP_OS2) PurePrintf(0); #endif XPTC_InvokeByIndex(nsnull, 0, 0, nsnull); @@ -261,7 +263,7 @@ void XXXNeverCalled() b.ToString(0, y); } -#ifndef WINCE +#if !defined(WINCE) && !defined(XP_OS2) NS_NewWindowsRegKey(nsnull); #endif }