+/* libsigrok loglevels. */
+#define SR_LOG_NONE 0 /**< Output no messages at all. */
+#define SR_LOG_ERR 1 /**< Output error messages. */
+#define SR_LOG_WARN 2 /**< Output warnings. */
+#define SR_LOG_INFO 3 /**< Output informational messages. */
+#define SR_LOG_DBG 4 /**< Output debug messages. */
+#define SR_LOG_SPEW 5 /**< Output very noisy debug messages. */
+
+/*
+ * Use SR_API to mark public API symbols, and SR_PRIV for private symbols.
+ *
+ * Variables and functions marked 'static' are private already and don't
+ * need SR_PRIV. However, functions which are not static (because they need
+ * to be used in other libsigrok-internal files) but are also not meant to
+ * be part of the public libsigrok API, must use SR_PRIV.
+ *
+ * This uses the 'visibility' feature of gcc (requires gcc >= 4.0).
+ *
+ * Details: http://gcc.gnu.org/wiki/Visibility
+ */
+
+/* Marks public libsigrok API symbols. */
+#define SR_API __attribute__((visibility("default")))
+
+/* Marks private, non-public libsigrok symbols (not part of the API). */
+#define SR_PRIV __attribute__((visibility("hidden")))
+