[dia: 99/105] #19 review: revert changes to definition of DIAVAR.



commit 5336673bdf3fede8793800c9bf3113543b8ad78d
Author: Eduard Nicodei <eddnicodei gmail com>
Date:   Sun Jan 27 12:18:14 2019 +0000

    #19 review: revert changes to definition of DIAVAR.
    
      - DIAVAR should be defined either ar __declspec(dllexport) or
        __declspec(dllimport) depending on whether we are building libdia
        (dllexport) or anything else (dllimport in that case).
      - This was first changed in ae7d79bf93.
        The argument there was that LIBDIA_COMPILATION is defined in all
        Makefiles.  This is not true.  It is only defined in lib/Makefile.am
      - All thanks go to @jpakkane for pointing this out:
        https://gitlab.gnome.org/GNOME/dia/merge_requests/14#note_420164

 lib/diavar.h    | 6 +++++-
 lib/meson.build | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/lib/diavar.h b/lib/diavar.h
index f30d3fac..83198d6b 100644
--- a/lib/diavar.h
+++ b/lib/diavar.h
@@ -4,7 +4,11 @@
 #include <glib.h>
 
 #ifdef G_OS_WIN32
-#  define DIAVAR __declspec(dllexport)
+#  ifdef LIBDIA_COMPILATION
+#    define DIAVAR __declspec(dllexport)
+#  else  /* !LIBDIA_COMPILATION */
+#    define DIAVAR __declspec(dllimport)
+#  endif /* !LIBDIA_COMPILATION */
 #else  /* !G_OS_WIN32 */
 #  /* DONT: define DIAVAR extern */
 #  define DIAVAR /* empty */
diff --git a/lib/meson.build b/lib/meson.build
index 652c6058..a1c5dcdf 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -124,7 +124,7 @@ libdia = library('dia',
     libdia_sources + [diamarshal, dia_lib_icons_h, config_h],
     dependencies: libdia_deps,
     include_directories: configuration_inc,
-    c_args: ['-Wall'],
+    c_args: ['-Wall', '-DLIBDIA_COMPILATION'],
     vs_module_defs: files('libdia.def')[0],
     install: true,
 )


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