changeset 2823:b1ff739d0dbc

Make dwcompat.h allow mixing of C and C++ code. GitHub issue #3. Also fix a minor whitespace issue.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 14 Aug 2022 15:36:36 +0000
parents 0adf73d5d8c2
children 22327163b35c
files dwcompat.h mac/dw.m
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dwcompat.h	Thu Aug 04 19:12:19 2022 +0000
+++ b/dwcompat.h	Sun Aug 14 15:36:36 2022 +0000
@@ -3,6 +3,10 @@
 #ifndef _DWCOMPAT_H
 #define _DWCOMPAT_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* This header includes and defines everything needed for a given OS/compiler */
 #if defined(__UNIX__) || defined(__MAC__) || defined(__IOS__) || defined(__ANDROID__)
 /* iOS and Android currently don't use autoconf */
@@ -477,4 +481,8 @@
 void API initdir(int argc, char *argv[]);
 int API setpath(char *path);
 
+#ifdef __cplusplus
+}
 #endif
+
+#endif
--- a/mac/dw.m	Thu Aug 04 19:12:19 2022 +0000
+++ b/mac/dw.m	Sun Aug 14 15:36:36 2022 +0000
@@ -12621,7 +12621,7 @@
     if(!_dw_bundle_path[0])
         getcwd(_dw_bundle_path, PATH_MAX);
 
-	/* Set the locale... if it is UTF-8 pass it
+    /* Set the locale... if it is UTF-8 pass it
      * directly, otherwise specify UTF-8 explicitly.
      */
     setlocale(LC_ALL, lang && strstr(lang, ".UTF-8") ? lang : "UTF-8");