mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 19:43:32 +00:00
105 lines
2.6 KiB
C
105 lines
2.6 KiB
C
|
#ifndef COSMOPOLITAN_THIRD_PARTY_ZLIB_MACROS_INTERNAL_H_
|
||
|
#define COSMOPOLITAN_THIRD_PARTY_ZLIB_MACROS_INTERNAL_H_
|
||
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||
|
COSMOPOLITAN_C_START_
|
||
|
/* clang-format off */
|
||
|
|
||
|
#ifndef OF /* function prototypes */
|
||
|
# ifdef STDC
|
||
|
# define OF(args) args
|
||
|
# else
|
||
|
# define OF(args) ()
|
||
|
# endif
|
||
|
#endif
|
||
|
|
||
|
#ifndef Z_ARG /* function prototypes for stdarg */
|
||
|
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
|
||
|
# define Z_ARG(args) args
|
||
|
# else
|
||
|
# define Z_ARG(args) ()
|
||
|
# endif
|
||
|
#endif
|
||
|
|
||
|
/* The following definitions for FAR are needed only for MSDOS mixed
|
||
|
* model programming (small or medium model with some far allocations).
|
||
|
* This was tested only with MSC; for other MSDOS compilers you may have
|
||
|
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||
|
* just define FAR to be empty.
|
||
|
*/
|
||
|
#ifdef SYS16BIT
|
||
|
# if defined(M_I86SM) || defined(M_I86MM)
|
||
|
/* MSC small or medium model */
|
||
|
# define SMALL_MEDIUM
|
||
|
# ifdef _MSC_VER
|
||
|
# define FAR _far
|
||
|
# else
|
||
|
# define FAR far
|
||
|
# endif
|
||
|
# endif
|
||
|
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
||
|
/* Turbo C small or medium model */
|
||
|
# define SMALL_MEDIUM
|
||
|
# ifdef __BORLANDC__
|
||
|
# define FAR _far
|
||
|
# else
|
||
|
# define FAR far
|
||
|
# endif
|
||
|
# endif
|
||
|
#endif
|
||
|
|
||
|
#if defined(WINDOWS) || defined(WIN32)
|
||
|
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||
|
* This is not mandatory, but it offers a little performance increase.
|
||
|
*/
|
||
|
# ifdef ZLIB_DLL
|
||
|
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
||
|
# ifdef ZLIB_INTERNAL
|
||
|
# define ZEXTERN extern __declspec(dllexport)
|
||
|
# else
|
||
|
# define ZEXTERN extern __declspec(dllimport)
|
||
|
# endif
|
||
|
# endif
|
||
|
# endif /* ZLIB_DLL */
|
||
|
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||
|
* define ZLIB_WINAPI.
|
||
|
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
||
|
*/
|
||
|
# ifdef ZLIB_WINAPI
|
||
|
# ifdef FAR
|
||
|
# undef FAR
|
||
|
# endif
|
||
|
# include <windows.h>
|
||
|
/* No need for _export, use ZLIB.DEF instead. */
|
||
|
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||
|
# define ZEXPORT WINAPI
|
||
|
# ifdef WIN32
|
||
|
# define ZEXPORTVA WINAPIV
|
||
|
# else
|
||
|
# define ZEXPORTVA FAR CDECL
|
||
|
# endif
|
||
|
# endif
|
||
|
#endif
|
||
|
|
||
|
#ifndef ZEXTERN
|
||
|
# define ZEXTERN extern
|
||
|
#endif
|
||
|
#ifndef ZEXPORT
|
||
|
# define ZEXPORT
|
||
|
#endif
|
||
|
#ifndef ZEXPORTVA
|
||
|
# define ZEXPORTVA
|
||
|
#endif
|
||
|
|
||
|
#ifndef FAR
|
||
|
# define FAR
|
||
|
#endif
|
||
|
#ifndef far
|
||
|
# define far
|
||
|
#endif
|
||
|
|
||
|
#define z_off_t long
|
||
|
|
||
|
COSMOPOLITAN_C_END_
|
||
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||
|
#endif /* COSMOPOLITAN_THIRD_PARTY_ZLIB_MACROS_INTERNAL_H_ */
|