From 645dade3b336cc0ce041b0ef25cfa5c2e6947115 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 15 Jul 2026 12:43:15 +0200 Subject: [PATCH] version: add `Unicode:on/off` to `libssh2_build_options()` Also: fail the build if `UNICODE` is set without `_UNICODE` or vice versa. Closes #2316 --- src/libssh2_setup.h | 7 +++++++ src/version.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/libssh2_setup.h b/src/libssh2_setup.h index daeae668..97c5c0cb 100644 --- a/src/libssh2_setup.h +++ b/src/libssh2_setup.h @@ -51,6 +51,13 @@ #ifdef _WIN32 +#if defined(UNICODE) && !defined(_UNICODE) +# error "UNICODE is defined but _UNICODE is not defined" +#endif +#if defined(_UNICODE) && !defined(UNICODE) +# error "_UNICODE is defined but UNICODE is not defined" +#endif + #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif diff --git a/src/version.c b/src/version.c index 3c41733c..d77a2bf4 100644 --- a/src/version.c +++ b/src/version.c @@ -179,6 +179,15 @@ static const char *ssh2_build_options = #ifdef SSH2_AGENT_BACKEND_UNIX "agent:" SSH2_AGENT_BACKEND_UNIX " " +#endif +#ifdef _WIN32 + "Unicode:" +#if defined(UNICODE) && defined(_UNICODE) + "on" +#else + "off" +#endif + " " #endif "clear-memory:" #ifndef LIBSSH2_NO_CLEAR_MEMORY