This makes the behavior on Windows consistent with other platforms.
Also attempt to detect iOS, and set the default OS value to 'apple-ios'
there. As far as we know, no one has built LibOpenConnect on iOS (see
https://gitlab.com/openconnect/openconnect/-/issues/163), but this should
help future-proof it.
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
if (!os) {
#if defined(__APPLE__)
+# include <TargetConditionals.h>
+# if TARGET_OS_IOS
+ /* We need to use Apple's boolean "target" defines to distinguish iOS from
+ * desktop MacOS. See https://stackoverflow.com/a/5920028 and
+ * https://github.com/mstg/iOS-full-sdk/blob/master/iPhoneOS9.3.sdk/usr/include/TargetConditionals.h#L64-L71
+ */
+ os = "apple-ios";
+# else
os = "mac-intel";
+# endif
#elif defined(__ANDROID__)
os = "android";
+#elif defined(_WIN32)
+ os = "win";
#else
os = sizeof(long) > 4 ? "linux-64" : "linux";
#endif