]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Improve handling of 'extern' on Win32 and Cygwin
authorwszqkzqk <wszqkzqk@qq.com>
Wed, 11 Jan 2023 05:44:34 +0000 (13:44 +0800)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 11 Jan 2023 08:37:37 +0000 (09:37 +0100)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1398

codegen/valaccodebasemodule.vala

index 13759dec4120802cdd2dbe9f0640c2593a0b72d2..5d765c314b43f8efe083b49d605f317d8705f4df 100644 (file)
@@ -826,7 +826,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                var extern_define = new CCodeIfSection ("!defined(VALA_EXTERN)");
 
                CCodeIfSection if_section;
-               if_section = new CCodeIfSection ("defined(_MSC_VER)");
+               if_section = new CCodeIfSection ("defined(_WIN32) || defined(__CYGWIN__)");
                extern_define.append (if_section);
                if_section.append (new CCodeDefine ("VALA_EXTERN", "__declspec(dllexport) extern"));
                if_section = if_section.append_else ("__GNUC__ >= 4");