From b003e95b91d47e35efdf634111769d1c185f7cd2 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 12 Dec 2016 00:35:21 -0500 Subject: api headers: added ntcon_{abi|compiler}.h for smooth foreign toolchain support. --- include/ntcon/ntcon_abi.h | 54 ++++++++++++++++++++++++++++++++++++++++++ include/ntcon/ntcon_api.h | 4 ++-- include/ntcon/ntcon_compiler.h | 30 +++++++++++++++++++++++ include/ntcon/ntcon_env.h | 22 ----------------- project/headers.mk | 3 ++- 5 files changed, 88 insertions(+), 25 deletions(-) create mode 100644 include/ntcon/ntcon_abi.h create mode 100644 include/ntcon/ntcon_compiler.h delete mode 100644 include/ntcon/ntcon_env.h diff --git a/include/ntcon/ntcon_abi.h b/include/ntcon/ntcon_abi.h new file mode 100644 index 0000000..63af119 --- /dev/null +++ b/include/ntcon/ntcon_abi.h @@ -0,0 +1,54 @@ +#ifndef _NTCON_ABI_H_ +#define _NTCON_ABI_H_ + +#ifdef _MIDIPIX_FREESTANDING + +#include + +#else + +#include +#include + +#ifndef __in +#define __in +#endif + +#ifndef __out +#define __out +#endif + +#ifndef __in_opt +#define __in_opt +#endif + +#ifndef __out_opt +#define __out_opt +#endif + +#ifndef __in_out +#define __in_out +#endif + +#ifndef __in_out_opt +#define __in_out_opt +#endif + +#ifndef __optional +#define __optional +#endif + +#ifndef __reserved +#define __reserved +#endif + +#ifndef __inline__ +#define __inline__ __inline +#endif + +typedef unsigned short wchar16_t; +typedef unsigned int wchar32_t; + +#endif + +#endif diff --git a/include/ntcon/ntcon_api.h b/include/ntcon/ntcon_api.h index dd5d71b..beb5a68 100644 --- a/include/ntcon/ntcon_api.h +++ b/include/ntcon/ntcon_api.h @@ -1,8 +1,8 @@ #ifndef NTCON_API_H #define NTCON_API_H -/* host type (posix-libc/free-standing) */ -#include "ntcon_env.h" +#include "ntcon_abi.h" +#include "ntcon_compiler.h" /* ntcon_export */ #if defined(__attr_export__) diff --git a/include/ntcon/ntcon_compiler.h b/include/ntcon/ntcon_compiler.h new file mode 100644 index 0000000..e8a4de6 --- /dev/null +++ b/include/ntcon/ntcon_compiler.h @@ -0,0 +1,30 @@ +#ifndef _NTCON_COMPILER_H_ +#define _NTCON_COMPILER_H_ + +#include "ntcon_abi.h" + +#ifndef _MIDIPIX_FREESTANDING + +#ifdef _MSC_VER + +/* visual studio: begin */ +#ifndef __attr_export__ +#define __attr_export__ __declspec(dllexport) +#define __attr_import__ __declspec(dllimport) +#endif +/* visual studio: end */ + +#else + +/* all other compilers: begin */ +#ifndef __attr_export__ +#define __attr_export__ __attribute__((__dllexport__)) +#define __attr_import__ __attribute__((__dllimport__)) +#endif +/* all other compilers: end */ + +#endif + +#endif + +#endif diff --git a/include/ntcon/ntcon_env.h b/include/ntcon/ntcon_env.h deleted file mode 100644 index c2e3564..0000000 --- a/include/ntcon/ntcon_env.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef NTCON_ENV_H -#define NTCON_ENV_H - -#if defined (_MIDIPIX_FREESTANDING) - -#include - -#else - -#include - -#ifndef __cdecl -#define __cdecl -#endif - -#ifndef __stdcall -#define __stdcall -#endif - -#endif - -#endif diff --git a/project/headers.mk b/project/headers.mk index eeb1c5c..cd0f8b9 100644 --- a/project/headers.mk +++ b/project/headers.mk @@ -1,7 +1,8 @@ API_HEADERS = \ $(PROJECT_DIR)/include/$(PACKAGE)/ntcon.h \ + $(PROJECT_DIR)/include/$(PACKAGE)/ntcon_abi.h \ $(PROJECT_DIR)/include/$(PACKAGE)/ntcon_api.h \ - $(PROJECT_DIR)/include/$(PACKAGE)/ntcon_env.h \ + $(PROJECT_DIR)/include/$(PACKAGE)/ntcon_compiler.h \ $(PROJECT_DIR)/include/$(PACKAGE)/ntcon_vkcode.h \ INTERNAL_HEADERS = -- cgit v1.2.3