aboutsummaryrefslogtreecommitdiff
path: root/include/libtio/native.h
diff options
context:
space:
mode:
authorThomas Touhey <thomas@touhey.fr>2019-04-28 21:08:28 +0200
committerThomas Touhey <thomas@touhey.fr>2019-04-28 21:08:28 +0200
commit30a5c6e2a5bd757a24262231e70c3a912cdfcbee (patch)
tree847d39a9ad02b6764f17fdc2b82c6bd2165a7f79 /include/libtio/native.h
parenta77576473eab464772cef97f8b1f72a98abbb891 (diff)
Updated serial attributes and copied stuff for partial Windows handles support
Diffstat (limited to 'include/libtio/native.h')
-rw-r--r--include/libtio/native.h41
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)