aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-31 13:36:58 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-31 13:36:58 -0800
commitb56a1d17ce1c531a8ae05b0d93eaf761bea1476f (patch)
tree6fc3f80a264d11e8f80a84f9c875112b6f10a4aa /include
parentb0874b1dad787c32093a3ff81311e2d638dc6538 (diff)
downloadnng-b56a1d17ce1c531a8ae05b0d93eaf761bea1476f.tar.gz
nng-b56a1d17ce1c531a8ae05b0d93eaf761bea1476f.tar.bz2
nng-b56a1d17ce1c531a8ae05b0d93eaf761bea1476f.zip
api: add NNG1_MIGRATION transition assistance macro
Diffstat (limited to 'include')
-rw-r--r--include/nng/nng.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h
index e4e97f86..16fcf51b 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -1608,6 +1608,23 @@ NNG_DECL int nng_tls_config_psk(
NNG_DECL int nng_tls_config_version(
nng_tls_config *, nng_tls_version, nng_tls_version);
+// These transition macros may help with migration from NNG1.
+// Applications should try to avoid depending on these any longer than
+// necessary, as they may be removed in a future update. This is far from a
+// sufficient set for a transition.
+#ifdef NNG1_TRANSITION
+#define nng_nop() \
+ do { \
+ } while (0)
+#define nng_close(s) nng_socket_close(s)
+#define nng_inproc_register() nng_nop()
+#define nng_ipc_register() nng_nop()
+#define nng_tls_register() nng_nop()
+#define nng_ws_register() nng_nop()
+#define nng_wss_register() nng_nop()
+#define nng_zt_register() nng_nop()
+#endif
+
#ifdef __cplusplus
}
#endif