summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrinivas%netscape.com <devnull@localhost>2000-01-06 01:45:29 +0000
committersrinivas%netscape.com <devnull@localhost>2000-01-06 01:45:29 +0000
commitf569bd2dc2a5d45a8e007b4ecd39ddd626ec9327 (patch)
tree925076cd408eeff0864da3a761f3dc3ff7f864e2
parent0997aa0d8af8618c73573a2fbbabe655e883ec03 (diff)
downloadnspr-hg-f569bd2dc2a5d45a8e007b4ecd39ddd626ec9327.tar.gz
Support platform-specific import declaration for public NSPR functions.
Bugzilla #12913. rwtc.
-rw-r--r--pr/include/prlock.h8
-rw-r--r--pr/include/prtypes.h47
-rw-r--r--pr/src/Makefile2
-rw-r--r--pr/src/bthreads/Makefile2
-rw-r--r--pr/src/cplus/Makefile2
-rw-r--r--pr/src/io/Makefile2
-rw-r--r--pr/src/linking/Makefile2
-rw-r--r--pr/src/malloc/Makefile2
-rw-r--r--pr/src/md/Makefile2
-rw-r--r--pr/src/md/beos/Makefile2
-rw-r--r--pr/src/md/os2/Makefile2
-rw-r--r--pr/src/md/unix/Makefile2
-rw-r--r--pr/src/md/windows/Makefile2
-rw-r--r--pr/src/memory/Makefile2
-rw-r--r--pr/src/misc/Makefile2
-rw-r--r--pr/src/pthreads/Makefile2
-rw-r--r--pr/src/threads/Makefile2
-rw-r--r--pr/src/threads/combined/Makefile2
18 files changed, 83 insertions, 4 deletions
diff --git a/pr/include/prlock.h b/pr/include/prlock.h
index 05e59446..0017f71d 100644
--- a/pr/include/prlock.h
+++ b/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/pr/include/prtypes.h b/pr/include/prtypes.h
index 8aaf594e..613aa9f7 100644
--- a/pr/include/prtypes.h
+++ b/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/pr/src/Makefile b/pr/src/Makefile
index 8f7c4416..c064e7ad 100644
--- a/pr/src/Makefile
+++ b/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/pr/src/bthreads/Makefile b/pr/src/bthreads/Makefile
index 4f20d205..1bddbdc0 100644
--- a/pr/src/bthreads/Makefile
+++ b/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/pr/src/cplus/Makefile b/pr/src/cplus/Makefile
index 48312806..35c9df7b 100644
--- a/pr/src/cplus/Makefile
+++ b/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/pr/src/io/Makefile b/pr/src/io/Makefile
index 47bd41b7..692976e7 100644
--- a/pr/src/io/Makefile
+++ b/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/pr/src/linking/Makefile b/pr/src/linking/Makefile
index 4672384a..26baca79 100644
--- a/pr/src/linking/Makefile
+++ b/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/pr/src/malloc/Makefile b/pr/src/malloc/Makefile
index 947c327e..1e85dc5c 100644
--- a/pr/src/malloc/Makefile
+++ b/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/pr/src/md/Makefile b/pr/src/md/Makefile
index 780fcba2..765d0f62 100644
--- a/pr/src/md/Makefile
+++ b/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/pr/src/md/beos/Makefile b/pr/src/md/beos/Makefile
index e286be58..ce21aece 100644
--- a/pr/src/md/beos/Makefile
+++ b/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/pr/src/md/os2/Makefile b/pr/src/md/os2/Makefile
index 77689e24..6e9390dc 100644
--- a/pr/src/md/os2/Makefile
+++ b/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/pr/src/md/unix/Makefile b/pr/src/md/unix/Makefile
index f0900281..de8baadd 100644
--- a/pr/src/md/unix/Makefile
+++ b/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/pr/src/md/windows/Makefile b/pr/src/md/windows/Makefile
index dcce31d1..78a6527f 100644
--- a/pr/src/md/windows/Makefile
+++ b/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/pr/src/memory/Makefile b/pr/src/memory/Makefile
index dde16b2d..25762308 100644
--- a/pr/src/memory/Makefile
+++ b/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/pr/src/misc/Makefile b/pr/src/misc/Makefile
index fd78f117..fd3985c2 100644
--- a/pr/src/misc/Makefile
+++ b/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/pr/src/pthreads/Makefile b/pr/src/pthreads/Makefile
index adae2a78..d2700995 100644
--- a/pr/src/pthreads/Makefile
+++ b/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/pr/src/threads/Makefile b/pr/src/threads/Makefile
index d9ce2ca2..0294ca57 100644
--- a/pr/src/threads/Makefile
+++ b/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/pr/src/threads/combined/Makefile b/pr/src/threads/combined/Makefile
index 19e676d4..f45fdecb 100644
--- a/pr/src/threads/combined/Makefile
+++ b/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)