mirror of https://git.tukaani.org/xz.git
Use __cdecl also for function pointers in liblzma API when
on Windows.
This commit is contained in:
parent
6a2eb54092
commit
d64ca34f1b
|
@ -154,15 +154,19 @@
|
||||||
******************/
|
******************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some systems require that the functions are declared specially
|
* Some systems require (or at least recommend) that the functions and
|
||||||
* in the headers.
|
* function pointers are declared specially in the headers.
|
||||||
*/
|
*/
|
||||||
|
#ifdef _WIN32
|
||||||
|
# define LZMA_API_CALL __cdecl
|
||||||
|
# define LZMA_API_IMPORT __declspec(dllimport)
|
||||||
|
#else
|
||||||
|
# define LZMA_API_CALL
|
||||||
|
# define LZMA_API_IMPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef LZMA_API
|
#ifndef LZMA_API
|
||||||
# if defined(_WIN32)
|
# define LZMA_API LZMA_API_CALL LZMA_API_IMPORT
|
||||||
# define LZMA_API __cdecl __declspec(dllimport)
|
|
||||||
# else
|
|
||||||
# define LZMA_API
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -376,7 +376,7 @@ typedef struct {
|
||||||
* returned NULL if some function from liblzma
|
* returned NULL if some function from liblzma
|
||||||
* returns LZMA_MEM_ERROR.
|
* returns LZMA_MEM_ERROR.
|
||||||
*/
|
*/
|
||||||
void *(*alloc)(void *opaque, size_t nmemb, size_t size);
|
void *(LZMA_API_CALL *alloc)(void *opaque, size_t nmemb, size_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Pointer to a custom memory freeing function
|
* \brief Pointer to a custom memory freeing function
|
||||||
|
@ -390,7 +390,7 @@ typedef struct {
|
||||||
* or when it is set to NULL, a pointer returned
|
* or when it is set to NULL, a pointer returned
|
||||||
* by the standard malloc().
|
* by the standard malloc().
|
||||||
*/
|
*/
|
||||||
void (*free)(void *opaque, void *ptr);
|
void (LZMA_API_CALL *free)(void *opaque, void *ptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Pointer passed to .alloc() and .free()
|
* \brief Pointer passed to .alloc() and .free()
|
||||||
|
|
|
@ -24,20 +24,16 @@
|
||||||
#include "../../common/mythread.h"
|
#include "../../common/mythread.h"
|
||||||
#include "../../common/integer.h"
|
#include "../../common/integer.h"
|
||||||
|
|
||||||
// Don't use ifdef...
|
#if defined(_WIN32)
|
||||||
#if HAVE_VISIBILITY
|
# define LZMA_API_EXPORT __declspec(dllexport)
|
||||||
# define LZMA_VISIBILITY __attribute__((__visibility__("default")))
|
// Don't use ifdef or defined() below.
|
||||||
|
#elif HAVE_VISIBILITY
|
||||||
|
# define LZMA_API_EXPORT __attribute__((__visibility__("default")))
|
||||||
#else
|
#else
|
||||||
# define LZMA_VISIBILITY
|
# define LZMA_API_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#define LZMA_API LZMA_API_CALL LZMA_API_EXPORT
|
||||||
# define LZMA_EXPORT __cdecl __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
# define LZMA_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LZMA_API LZMA_VISIBILITY LZMA_EXPORT
|
|
||||||
|
|
||||||
#include "lzma.h"
|
#include "lzma.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue