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") %{
#ifndef SWIGIMPORT
# ifndef __GNUC__
# define __DLL_IMPORT __declspec(dllimport)
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGDLLIMPORT
# else
# define SWIGDLLIMPORT __declspec(dllimport)
# endif
# else
# define __DLL_IMPORT __attribute__((dllimport)) extern
# endif
# if !defined (__WIN32__)
# define SWIGIMPORT extern
# else
# define SWIGIMPORT __DLL_IMPORT
# define SWIGDLLIMPORT
# endif
# define SWIGIMPORT extern SWIGDLLIMPORT
#endif
#include <stddef.h>