OSDN Git Service

Force "C" linkage for setup key definitions.
authorKeith Marshall <keith@users.osdn.me>
Fri, 19 Jun 2020 12:52:56 +0000 (13:52 +0100)
committerKeith Marshall <keith@users.osdn.me>
Fri, 19 Jun 2020 12:52:56 +0000 (13:52 +0100)
ChangeLog
src/setup.cpp

index 1e62af5..b27b578 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2020-06-19  Keith Marshall  <keith@users.osdn.me>
 
+       Force "C" linkage for setup key definitions.
+
+       * src/setup.cpp (uri_key, mirror_key, value_none): Wrap them...
+       (BEGIN_C_DECLS, END_C_DECLS): ...between these.
+
+2020-06-19  Keith Marshall  <keith@users.osdn.me>
+
        Support all-static linking with recent GCC versions.
 
        * Makefile.in (LDFLAGS): Add "-static" unconditionally.
index 9e76778..b7a6a45 100644 (file)
@@ -3,8 +3,8 @@
  *
  * $Id$
  *
- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2013, MinGW.org Project
+ * Written by Keith Marshall <keith@users.osdn.me>
+ * Copyright (C) 2013, 2020, MinGW.org Project
  *
  *
  * Implementation of the mingw-get setup tool's dialogue controller.
@@ -138,11 +138,18 @@ static inline void BrowseLicenceDocument( HWND dlg, long x = 0, long y = 0 )
 /* The following string constants are abstracted from pkgkeys.c;
  * we redefine this minimal subset here, to avoid the overhead of
  * importing the entire content of the pkgkeys module.
+ *
+ * Note: All of these must be defined with "C" linkage, to comply
+ * with their original declarations in "pkgkeys.h".
  */
+BEGIN_C_DECLS
+
 static const char *uri_key = "uri";
 static const char *mirror_key = "mirror";
 static const char *value_none = "none";
 
+END_C_DECLS
+
 class SetupTool
 {
   /* Top level class, implementing the controlling features