diff --git a/nsprpub/pr/include/prlock.h b/nsprpub/pr/include/prlock.h index 05e59446eded..0017f71dcf98 100644 --- a/nsprpub/pr/include/prlock.h +++ b/nsprpub/pr/include/prlock.h @@ -61,7 +61,7 @@ typedef struct PRLock PRLock; ** is returned. ** ***********************************************************************/ -PR_EXTERN(PRLock*) PR_NewLock(void); +NSPR_API(PRLock*) PR_NewLock(void); /*********************************************************************** ** FUNCTION: PR_DestroyLock @@ -72,7 +72,7 @@ PR_EXTERN(PRLock*) PR_NewLock(void); ** OUTPUTS: void ** RETURN: None ***********************************************************************/ -PR_EXTERN(void) PR_DestroyLock(PRLock *lock); +NSPR_API(void) PR_DestroyLock(PRLock *lock); /*********************************************************************** ** FUNCTION: PR_Lock @@ -83,7 +83,7 @@ PR_EXTERN(void) PR_DestroyLock(PRLock *lock); ** OUTPUTS: void ** RETURN: None ***********************************************************************/ -PR_EXTERN(void) PR_Lock(PRLock *lock); +NSPR_API(void) PR_Lock(PRLock *lock); /*********************************************************************** ** FUNCTION: PR_Unlock @@ -95,7 +95,7 @@ PR_EXTERN(void) PR_Lock(PRLock *lock); ** RETURN: PR_STATUS ** Returns PR_FAILURE if the caller does not own the lock. ***********************************************************************/ -PR_EXTERN(PRStatus) PR_Unlock(PRLock *lock); +NSPR_API(PRStatus) PR_Unlock(PRLock *lock); PR_END_EXTERN_C diff --git a/nsprpub/pr/include/prtypes.h b/nsprpub/pr/include/prtypes.h index 8aaf594ea75e..613aa9f79669 100644 --- a/nsprpub/pr/include/prtypes.h +++ b/nsprpub/pr/include/prtypes.h @@ -68,6 +68,11 @@ #define _declspec(x) __declspec(x) #endif +#define PR_EXPORT(__type) extern _declspec(dllexport) __type +#define PR_EXPORT_DATA(__type) extern _declspec(dllexport) __type +#define PR_IMPORT(__type) _declspec(dllimport) __type +#define PR_IMPORT_DATA(__type) _declspec(dllimport) __type + #define PR_EXTERN(__type) extern _declspec(dllexport) __type #define PR_IMPLEMENT(__type) _declspec(dllexport) __type #define PR_EXTERN_DATA(__type) extern _declspec(dllexport) __type @@ -78,6 +83,12 @@ #define PR_STATIC_CALLBACK(__x) static __x #elif defined(XP_BEOS) + +#define PR_EXPORT(__type) extern _declspec(dllexport) __type +#define PR_EXPORT_DATA(__type) extern _declspec(dllexport) __type +#define PR_IMPORT(__type) extern _declspec(dllexport) __type +#define PR_IMPORT_DATA(__type) extern _declspec(dllexport) __type + #define PR_EXTERN(__type) extern __declspec(dllexport) __type #define PR_IMPLEMENT(__type) __declspec(dllexport) __type #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type @@ -92,6 +103,11 @@ #define PR_CALLBACK_DECL __cdecl #if defined(_WINDLL) +#define PR_EXPORT(__type) extern __type _cdecl _export _loadds +#define PR_IMPORT(__type) extern __type _cdecl _export _loadds +#define PR_EXPORT_DATA(__type) extern __type _export +#define PR_IMPORT_DATA(__type) extern __type _export + #define PR_EXTERN(__type) extern __type _cdecl _export _loadds #define PR_IMPLEMENT(__type) __type _cdecl _export _loadds #define PR_EXTERN_DATA(__type) extern __type _export @@ -101,6 +117,11 @@ #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK #else /* this must be .EXE */ +#define PR_EXPORT(__type) extern __type _cdecl _export +#define PR_IMPORT(__type) extern __type _cdecl _export +#define PR_EXPORT_DATA(__type) extern __type _export +#define PR_IMPORT_DATA(__type) extern __type _export + #define PR_EXTERN(__type) extern __type _cdecl _export #define PR_IMPLEMENT(__type) __type _cdecl _export #define PR_EXTERN_DATA(__type) extern __type _export @@ -111,6 +132,12 @@ #endif /* _WINDLL */ #elif defined(XP_MAC) + +#define PR_EXPORT(__type) extern _declspec(export) __type +#define PR_EXPORT_DATA(__type) extern _declspec(export) __type +#define PR_IMPORT(__type) extern _declspec(export) __type +#define PR_IMPORT_DATA(__type) extern _declspec(export) __type + #define PR_EXTERN(__type) extern __declspec(export) __type #define PR_IMPLEMENT(__type) __declspec(export) __type #define PR_EXTERN_DATA(__type) extern __declspec(export) __type @@ -121,6 +148,12 @@ #define PR_STATIC_CALLBACK(__x) static __x #elif defined(XP_OS2) + +#define PR_EXPORT(__type) extern __type +#define PR_EXPORT_DATA(__type) extern __type +#define PR_IMPORT(__type) extern __type +#define PR_IMPORT_DATA(__type) extern __type + #define PR_EXTERN(__type) extern __type #define PR_IMPLEMENT(__type) __type #define PR_EXTERN_DATA(__type) extern __type @@ -134,6 +167,12 @@ #endif #else /* Unix */ + +#define PR_EXPORT(__type) extern __type +#define PR_EXPORT_DATA(__type) extern __type +#define PR_IMPORT(__type) extern __type +#define PR_IMPORT_DATA(__type) extern __type + #define PR_EXTERN(__type) extern __type #define PR_IMPLEMENT(__type) __type #define PR_EXTERN_DATA(__type) extern __type @@ -144,6 +183,14 @@ #endif +#if defined(_NSPR_BUILD_) +#define NSPR_API(__type) PR_EXPORT(__type) +#define NSPR_DATA_API(__type) PR_EXPORT_DATA(__type) +#else +#define NSPR_API(__type) PR_IMPORT(__type) +#define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type) +#endif + /*********************************************************************** ** MACROS: PR_BEGIN_MACRO ** PR_END_MACRO diff --git a/nsprpub/pr/src/Makefile b/nsprpub/pr/src/Makefile index 8f7c4416ee9c..c064e7ad6623 100644 --- a/nsprpub/pr/src/Makefile +++ b/nsprpub/pr/src/Makefile @@ -364,6 +364,8 @@ else SUF = LL endif +DEFINES += -D_NSPR_BUILD_ + $(TINC): @$(MAKE_OBJDIR) @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC) diff --git a/nsprpub/pr/src/bthreads/Makefile b/nsprpub/pr/src/bthreads/Makefile index 4f20d205027b..1bddbdc070de 100644 --- a/nsprpub/pr/src/bthreads/Makefile +++ b/nsprpub/pr/src/bthreads/Makefile @@ -25,6 +25,8 @@ INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include include $(MOD_DEPTH)/config/rules.mk +DEFINES += -D_NSPR_BUILD_ + export:: $(TARGETS) install:: export diff --git a/nsprpub/pr/src/cplus/Makefile b/nsprpub/pr/src/cplus/Makefile index 48312806bba4..35c9df7bbb61 100644 --- a/nsprpub/pr/src/cplus/Makefile +++ b/nsprpub/pr/src/cplus/Makefile @@ -40,6 +40,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk HEADERS = *.h diff --git a/nsprpub/pr/src/io/Makefile b/nsprpub/pr/src/io/Makefile index 47bd41b72e10..692976e7a380 100644 --- a/nsprpub/pr/src/io/Makefile +++ b/nsprpub/pr/src/io/Makefile @@ -59,6 +59,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/linking/Makefile b/nsprpub/pr/src/linking/Makefile index 4672384a98bc..26baca791d2b 100644 --- a/nsprpub/pr/src/linking/Makefile +++ b/nsprpub/pr/src/linking/Makefile @@ -36,6 +36,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/malloc/Makefile b/nsprpub/pr/src/malloc/Makefile index 947c327e2a3a..1e85dc5c2932 100644 --- a/nsprpub/pr/src/malloc/Makefile +++ b/nsprpub/pr/src/malloc/Makefile @@ -32,6 +32,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + CSRCS = prmalloc.c prmem.c include $(MOD_DEPTH)/config/rules.mk diff --git a/nsprpub/pr/src/md/Makefile b/nsprpub/pr/src/md/Makefile index 780fcba2dbeb..765d0f620599 100644 --- a/nsprpub/pr/src/md/Makefile +++ b/nsprpub/pr/src/md/Makefile @@ -50,6 +50,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/md/beos/Makefile b/nsprpub/pr/src/md/beos/Makefile index e286be58d915..ce21aecec4f5 100644 --- a/nsprpub/pr/src/md/beos/Makefile +++ b/nsprpub/pr/src/md/beos/Makefile @@ -21,6 +21,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/md/os2/Makefile b/nsprpub/pr/src/md/os2/Makefile index 77689e247abe..6e9390dc2c2e 100644 --- a/nsprpub/pr/src/md/os2/Makefile +++ b/nsprpub/pr/src/md/os2/Makefile @@ -40,6 +40,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/md/unix/Makefile b/nsprpub/pr/src/md/unix/Makefile index f09002817e66..de8baadd25a7 100644 --- a/nsprpub/pr/src/md/unix/Makefile +++ b/nsprpub/pr/src/md/unix/Makefile @@ -280,6 +280,8 @@ endif INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/md/windows/Makefile b/nsprpub/pr/src/md/windows/Makefile index dcce31d166b8..78a6527ff282 100644 --- a/nsprpub/pr/src/md/windows/Makefile +++ b/nsprpub/pr/src/md/windows/Makefile @@ -76,6 +76,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/memory/Makefile b/nsprpub/pr/src/memory/Makefile index dde16b2de66a..257623089ed7 100644 --- a/nsprpub/pr/src/memory/Makefile +++ b/nsprpub/pr/src/memory/Makefile @@ -34,6 +34,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/misc/Makefile b/nsprpub/pr/src/misc/Makefile index fd78f1175d89..fd3985c252a3 100644 --- a/nsprpub/pr/src/misc/Makefile +++ b/nsprpub/pr/src/misc/Makefile @@ -61,6 +61,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + RELEASE_BINS = compile-et.pl prerr.properties include $(MOD_DEPTH)/config/rules.mk diff --git a/nsprpub/pr/src/pthreads/Makefile b/nsprpub/pr/src/pthreads/Makefile index adae2a789c66..d2700995de9f 100644 --- a/nsprpub/pr/src/pthreads/Makefile +++ b/nsprpub/pr/src/pthreads/Makefile @@ -39,6 +39,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/threads/Makefile b/nsprpub/pr/src/threads/Makefile index d9ce2ca29a2e..0294ca572b15 100644 --- a/nsprpub/pr/src/threads/Makefile +++ b/nsprpub/pr/src/threads/Makefile @@ -68,6 +68,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS) diff --git a/nsprpub/pr/src/threads/combined/Makefile b/nsprpub/pr/src/threads/combined/Makefile index 19e676d4aae5..f45fdecbab8f 100644 --- a/nsprpub/pr/src/threads/combined/Makefile +++ b/nsprpub/pr/src/threads/combined/Makefile @@ -45,6 +45,8 @@ TARGETS = $(OBJS) INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private +DEFINES += -D_NSPR_BUILD_ + include $(MOD_DEPTH)/config/rules.mk export:: $(TARGETS)