diff options
Diffstat (limited to 'include/libtio/native.h')
-rw-r--r-- | include/libtio/native.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/libtio/native.h b/include/libtio/native.h index 0b7e899..d6e832c 100644 --- a/include/libtio/native.h +++ b/include/libtio/native.h @@ -6,6 +6,47 @@ TIO_BEGIN_NAMESPACE TIO_BEGIN_DECLS +/* --- + * Native support macros defining. + * --- */ + +/* Macros defined (or not) in the config.h header (included by cdefs.h): + * + * - `LIBTIO_DISABLED_FILE`: disable stdio's FILE support. + * - `LIBTIO_DISABLED_LIBUSB`: disable libusb support. + * + * Macros defined hereafter: + * + * - `LIBTIO_DISABLED_UNIX`: disable POSIX (unistd.h) support. + * - `LIBTIO_DISABLED_WINDOWS`: disable Windows API support. + * - `LIBTIO_DISABLED_DEV_SERIAL`: disable Linux's /dev/serial support. + * - `LIBTIO_DISABLED_CU_SERIAL`: disable BSD's /dev/cu.* support. */ + +# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L +# else +# define LIBTIO_DISABLED_UNIX 1 +# endif + +# if defined(_WIN16) || defined(_WIN32) || defined(_WIN64) \ + || defined(__WINDOWS__) +# else +# define LIBTIO_DISABLED_WINDOWS +# endif + +# if defined(__linux__) +# else +# define LIBTIO_DISABLED_DEV_SERIAL 1 +# endif + +# if defined(__APPLE__) && defined(__MACH__) +# else +# define LIBTIO_DISABLED_CU_SERIAL 1 +# endif + +/* --- + * Native stream opening functions. + * --- */ + /* UNIX streams. */ # if !defined(LIBTIO_DISABLED_UNIX) |