[gtkmm/gtkmm-3-22.nmake: 2/6] gendef: Skip CRT symbols that are implemented inline



commit 1d6ea26b284e76e509df85114d7bdd848f1634f7
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Aug 24 17:20:35 2018 +0800

    gendef: Skip CRT symbols that are implemented inline
    
    As a result to the move of UCRT for Visual Studio 2015 and later, some
    of the CRT functions are no longer done in the CRT DLL, but are instead
    implemented directly in the CRT headers.  We need to filter out these
    symbols so that we can link the gtkmm DLL properly.
    
    Unfortunately we cannot just link to legacy_stdio_definitions.lib to
    resolve this, so we just have to strip these symbols out from the
    generated gtkmm.def.

 MSVC_NMake/gendef/gendef.cc | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/MSVC_NMake/gendef/gendef.cc b/MSVC_NMake/gendef/gendef.cc
index 0b02fa39..db2dd099 100644
--- a/MSVC_NMake/gendef/gendef.cc
+++ b/MSVC_NMake/gendef/gendef.cc
@@ -76,12 +76,24 @@ int main(int argc,char** argv)
                          while(*e != ' ' && *e != '\t' && *e != '\0' && *e!= '\n') e++;
                          *e = '\0';
 
-                       if(strchr(s,'?')==0 && s[0]=='_' && strchr(s,'@') == 0 )//this is a C export type: 
_fct -> fct
-                                 def_file << "    " << (s+1) << endl;
-                       else
-                       if(strchr(s,'?')!=0 && strncmp(s,"??_G",4)!=0 && strncmp(s,"??_E",4)!=0) {
-                                 def_file << "    " << s << endl;
+#if (_MSC_VER >= 1900)
+                         /* Filter out these symbols as they are done inline in the
+                          * compiler-shipped headers, so that things can link properly on
+                          * later Visual Studio versions.  Unfortunately we can't just
+                          * link to legacy_stdio_definitions.lib, so this list below may
+                          * continue to grow.
+                          */
+                         if (_stricmp(s, "__local_stdio_printf_options") != 0 &&
+                             _stricmp(s, "_vsnprintf_l") != 0 &&
+                             _stricmp(s, "_vsprintf_l") != 0) {
+#endif
+                               if(strchr(s,'?')==0 && s[0]=='_' && strchr(s,'@') == 0 )//this is a C export 
type: _fct -> fct
+                                   def_file << "    " << (s+1) << endl;
+                               else if(strchr(s,'?')!=0 && strncmp(s,"??_G",4)!=0 && strncmp(s,"??_E",4)!=0)
+                                   def_file << "    " << s << endl;
+#if (_MSC_VER >= 1900)
                          }
+#endif
                  }
          }
   }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]