[internal] break API/ALLOC across headers once more to fix python

pull/2250/head
nick black 3 years ago
parent 75d5b9ee88
commit 7d6fdceb6e
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -7,6 +7,13 @@
extern "C" {
#endif
#ifndef __MINGW64__
#define API __attribute__((visibility("default")))
#else
#define API __declspec(dllexport)
#endif
#define ALLOC __attribute__((malloc)) __attribute__((warn_unused_result))
// ncdirect_init() will call setlocale() to inspect the current locale. If
// that locale is "C" or "POSIX", it will call setlocale(LC_ALL, "") to set
// the locale according to the LANG environment variable. Ideally, this will
@ -489,6 +496,9 @@ ncdirect_canbraille(const struct ncdirect* nc){
API bool ncdirect_canget_cursor(const struct ncdirect* nc)
__attribute__ ((nonnull (1)));
#undef API
#undef ALLOC
#ifdef __cplusplus
}
#endif

@ -12,7 +12,6 @@ extern "C" {
#ifndef __MINGW64__ // All but Windows
#include <netinet/in.h>
#define API __attribute__((visibility("default")))
#endif
#if defined(__linux__) // Linux
@ -32,14 +31,11 @@ extern "C" {
#define wcwidth(w) 1 // FIXME lol, no
#define wcswidth(w, s) (int)(wcslen(w)) // FIXME lol, no
#define htole(x) (x) // FIXME are all windows installs LE? ugh
#define API __declspec(dllexport)
#else // BSDs
#include <sys/endian.h>
#define htole(x) (bswap32(htonl(x)))
#endif
#define ALLOC __attribute__((malloc)) __attribute__((warn_unused_result))
#ifdef __cplusplus
} // extern "C"
#endif

@ -23,6 +23,13 @@ extern "C" {
#define RESTRICT restrict
#endif
#ifndef __MINGW64__
#define API __attribute__((visibility("default")))
#else
#define API __declspec(dllexport)
#endif
#define ALLOC __attribute__((malloc)) __attribute__((warn_unused_result))
// Get a human-readable string describing the running Notcurses version.
API const char* notcurses_version(void);
// Cannot be inline, as we want to get the versions of the actual Notcurses
@ -4129,6 +4136,9 @@ API uint32_t ncdirect_getc(struct ncdirect* nc, const struct timespec *ts,
const void* unused, ncinput* ni)
__attribute__ ((nonnull (1))) __attribute__ ((deprecated));
#undef API
#undef ALLOC
#ifdef __cplusplus
} // extern "C"
#endif

@ -12,6 +12,13 @@ extern "C" {
#include "notcurses/notcurses.h"
#include "notcurses/direct.h"
#ifndef __MINGW64__
#define API __attribute__((visibility("default")))
#else
#define API __declspec(dllexport)
#endif
#define ALLOC __attribute__((malloc)) __attribute__((warn_unused_result))
// KEY_EVENT is defined by both ncurses.h and wincon.h. since we don't use
// either definition, kill it before inclusion of ncurses.h.
#undef KEY_EVENT
@ -1784,6 +1791,9 @@ emit_scrolls(const tinfo* ti, int count, fbuf* f){
// replace or populate the TERM environment variable with 'termname'
int putenv_term(const char* termname) __attribute__ ((nonnull (1)));
#undef API
#undef ALLOC
#ifdef __cplusplus
}
#endif

Loading…
Cancel
Save