From d76e685c7a8f2b3a039661cd20af3ebaf114f78a Mon Sep 17 00:00:00 2001 From: Reece Date: Sat, 12 Jun 2021 19:11:24 +0100 Subject: [PATCH] [*] import/export api macros were omega scuffed --- bzlib.h | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/bzlib.h b/bzlib.h index 04d9711..1380bbc 100644 --- a/bzlib.h +++ b/bzlib.h @@ -66,38 +66,39 @@ typedef bz_stream; -#ifndef BZ_IMPORT -#define BZ_EXPORT +#if !defined(BZ_IMPORT) + #define BZ_EXPORT #endif -#ifndef BZ_NO_STDIO -/* Need a definitition for FILE */ -#include +#if !defined(BZ_NO_STDIO) + #include #endif #ifdef _WIN32 -# include -# ifdef small - /* windows.h define small to char */ -# undef small -# endif -# ifndef WINAPI -# define WINAPI -# endif -# ifdef BZ_EXPORT -# define BZ_API(func) WINAPI func -# define BZ_EXTERN extern -# else - /* import windows dll dynamically */ -# define BZ_API(func) (WINAPI * func) -# define BZ_EXTERN -# endif -#else -# define BZ_API(func) func + #define NOMINMAX + #include + + #ifdef small + #undef small + #endif +#endif + +#if !defined(BZ_NOEXPORT) + #ifdef BZ_EXPORT + #define BZ_API(func) __declspec(dllexport) func + #define BZ_EXTERN + #else + #define BZ_API(func) __declspec(dllimport) func + #define BZ_EXTERN + #endif #endif -#ifndef BZ_EXTERN -#define BZ_EXTERN extern +#if !defined(BZ_EXTERN) + #define BZ_EXTERN extern +#endif + +#if !defined(BZ_API) + #define BZ_API(func) func #endif /*-- Core (low-level) library functions --*/