summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/mkmakemod.sh9
-rw-r--r--Src/zsh.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/Src/mkmakemod.sh b/Src/mkmakemod.sh
index 6c9e8bcf1..0e8702ce3 100644
--- a/Src/mkmakemod.sh
+++ b/Src/mkmakemod.sh
@@ -427,8 +427,13 @@ if $first_stage; then
 	    echo "	    done; \\"
 	    if test "$CYGWIN" = yes; then
 		echo "	    echo '# ifndef IMPORTING_MODULE_${q_name} '; \\"
-		echo "	    echo '#  undef mod_import_variable'; \\"
-		echo "	    echo '#  define mod_import_variable __attribute__((__dllimport__))'; \\"
+		echo "      echo '#  ifdef MODULE'; \\"
+		echo "	    echo '#   undef mod_import_variable'; \\"
+		echo "	    echo '#   define mod_import_variable __attribute__((__dllimport__))'; \\"
+		echo "      echo '#  else /* MODULE */'; \\"
+		echo "      echo '#   undef mod_import_variable'; \\"
+		echo "      echo '#   define mod_import_variable'; \\"
+		echo "      echo '#  endif /* MODULE */'; \\"
 		echo "	    echo '# endif /* IMPORTING_MODULE_${q_name} */'; \\"
 	    fi
 	    echo "	    echo; \\"
diff --git a/Src/zsh.h b/Src/zsh.h
index dc24db2ed..fe17d6cd6 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1681,7 +1681,7 @@ typedef unsigned char * (*ZleReadFn) _((char *, char *, int));
 /* Pseudo-keyword to mark exportedness */
 /***************************************/
 
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) && defined(MODULE)
 #define mod_export __attribute__((__dllexport__))
 #define mod_import_variable __attribute__((__dllimport__))
 #define mod_import_function