Make SWIGIMPORT definition more consistent with SWIGEXPORT

Use the same checks as for the definition of SWIGEXPORT in
swiglabels.swg.

Also avoid defining __DLL_IMPORT symbol with a reserved name.
This commit is contained in:
Vadim Zeitlin 2021-10-15 23:20:21 +02:00
commit d65d7d7df3

View file

@ -4,16 +4,16 @@
%insert("cheader") %{ %insert("cheader") %{
#ifndef SWIGIMPORT #ifndef SWIGIMPORT
# ifndef __GNUC__ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define __DLL_IMPORT __declspec(dllimport) # if defined(STATIC_LINKED)
# define SWIGDLLIMPORT
# else
# define SWIGDLLIMPORT __declspec(dllimport)
# endif
# else # else
# define __DLL_IMPORT __attribute__((dllimport)) extern # define SWIGDLLIMPORT
# endif
# if !defined (__WIN32__)
# define SWIGIMPORT extern
# else
# define SWIGIMPORT __DLL_IMPORT
# endif # endif
# define SWIGIMPORT extern SWIGDLLIMPORT
#endif #endif
#include <stddef.h> #include <stddef.h>