From f05b4490d67b1fc220b4161d253e0c05be1ca969 Mon Sep 17 00:00:00 2001 From: "seawood%netscape.com" Date: Sat, 15 Dec 2001 13:15:24 +0000 Subject: [PATCH] Declaring callback functions appropriately. Fixing OS/2 tinderbox bustage --- modules/libjar/nsZipArchive.cpp | 6 ++++-- modules/libjar/zipstub.h | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp index 24fa401c96e..58b914c44a7 100644 --- a/modules/libjar/nsZipArchive.cpp +++ b/modules/libjar/nsZipArchive.cpp @@ -508,7 +508,8 @@ void nsZlibAllocator::zFree(void *ptr) return; } -static void *zlibAlloc(void *opaque, uInt items, uInt size) +PR_STATIC_CALLBACK(void *) +zlibAlloc(void *opaque, uInt items, uInt size) { nsZlibAllocator *zallocator = (nsZlibAllocator *)opaque; if (zallocator) @@ -517,7 +518,8 @@ static void *zlibAlloc(void *opaque, uInt items, uInt size) return calloc(items, size); } -static void zlibFree(void *opaque, void *ptr) +PR_STATIC_CALLBACK(void) +zlibFree(void *opaque, void *ptr) { nsZlibAllocator *zallocator = (nsZlibAllocator *)opaque; if (zallocator) diff --git a/modules/libjar/zipstub.h b/modules/libjar/zipstub.h index 1badae5336a..c0a25db527b 100644 --- a/modules/libjar/zipstub.h +++ b/modules/libjar/zipstub.h @@ -67,6 +67,15 @@ #define PR_PUBLIC_API(__type) __type #endif +#ifdef XP_OS2_VACPP +#define PR_CALLBACK _Optlink +#define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK +#else +#define PR_CALLBACK +#define PR_STATIC_CALLBACK(__x) static __x +#endif + + #define NS_STATIC_CAST(__type, __ptr) ((__type)(__ptr)) #define PRFileDesc FILE