about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Makefile.in20
-rw-r--r--Src/Modules/mathfunc.c26
-rw-r--r--Src/Modules/zftp.c12
-rw-r--r--Src/pattern.c2
4 files changed, 33 insertions, 27 deletions
diff --git a/Src/Makefile.in b/Src/Makefile.in
index 22b983c1b..bc6d29e10 100644
--- a/Src/Makefile.in
+++ b/Src/Makefile.in
@@ -50,7 +50,7 @@ DLLINK      = $(DLLD) $(LDFLAGS) $(LIBLDFLAGS) $(DLLDFLAGS) -o $@
 all: bin modules
 .PHONY: all
 
-bin: zsh
+bin: zsh$(EXEEXT)
 .PHONY: bin
 
 modules: headers
@@ -74,7 +74,7 @@ NNTRYOBJ   =
 LDRUNPATH = LD_RUN_PATH=$(libdir)/$(tzsh)
 NDRUNPATH =
 
-zsh: $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export
+zsh$(EXEEXT): $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export
 	rm -f $@
 	$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS)
 
@@ -176,16 +176,16 @@ uninstall.bin: uninstall.bin-here
 .PHONY: install.bin uninstall.bin
 
 # install binary, creating install directory if necessary
-install.bin-here: zsh install.bin-@L@
+install.bin-here: zsh$(EXEEXT) install.bin-@L@
 	$(sdir_top)/mkinstalldirs $(DESTDIR)$(bindir)
-	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)
-	if test -f $(DESTDIR)$(bindir)/$(tzsh); then \
+	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh$(EXEEXT) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)$(EXEEXT)
+	if test -f $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT); then \
 	    rm -f $(DESTDIR)$(bindir)/$(tzsh).old; \
-	    $(LN) $(DESTDIR)$(bindir)/$(tzsh) $(DESTDIR)$(bindir)/$(tzsh).old; \
+	    $(LN) $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT) $(DESTDIR)$(bindir)/$(tzsh).old; \
 	else :; fi
 	rm -f $(DESTDIR)$(bindir)/$(tzsh).new
-	$(LN) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh).new
-	mv $(DESTDIR)$(bindir)/$(tzsh).new $(DESTDIR)$(bindir)/$(tzsh)
+	$(LN) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)$(EXEEXT) $(DESTDIR)$(bindir)/$(tzsh).new
+	mv $(DESTDIR)$(bindir)/$(tzsh).new $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT)
 .PHONY: install.bin-here
 
 install.bin-N:
@@ -196,7 +196,7 @@ install.bin-L: $(LIBZSH)
 
 # uninstall binary
 uninstall.bin-here: uninstall.bin-@L@
-	rm -f $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh)
+	rm -f $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT)
 .PHONY: uninstall.bin-here uninstall.bin-@L@
 
 uninstall.bin-N:
@@ -215,7 +215,7 @@ mostlyclean-here:
 .PHONY: mostlyclean-here
 
 clean-here:
-	rm -f modules.index.tmp modules.stamp zsh ansi2knr.o ansi2knr
+	rm -f modules.index.tmp modules.stamp zsh$(EXEEXT) ansi2knr.o ansi2knr
 	rm -f modules.index modules-bltin
 	rm -f libzsh-*.$(DL_EXT)
 .PHONY: clean-here
diff --git a/Src/Modules/mathfunc.c b/Src/Modules/mathfunc.c
index 770894ce8..5ba7b557a 100644
--- a/Src/Modules/mathfunc.c
+++ b/Src/Modules/mathfunc.c
@@ -45,7 +45,6 @@ MF_CEIL,
 MF_COPYSIGN,
 MF_COS,
 MF_COSH,
-MF_DREM,
 MF_ERF,
 MF_ERFC,
 MF_EXP,
@@ -70,7 +69,9 @@ MF_LOGB,
 MF_NEXTAFTER,
 MF_RINT,
 MF_SCALB,
+#ifdef HAVE_SIGNGAM
 MF_SIGNGAM,
+#endif
 MF_SIN,
 MF_SINH,
 MF_SQRT,
@@ -78,7 +79,7 @@ MF_TAN,
 MF_TANH,
 MF_Y0,
 MF_Y1,
-MF_YN,
+MF_YN
 };
 
 /*
@@ -131,7 +132,6 @@ static struct mathfunc mftab[] = {
   NUMMATHFUNC("copysign", math_func, 2, 2, MF_COPYSIGN),
   NUMMATHFUNC("cos", math_func, 1, 1, MF_COS),
   NUMMATHFUNC("cosh", math_func, 1, 1, MF_COSH),
-  NUMMATHFUNC("drem", math_func, 2, 2, MF_DREM),
   NUMMATHFUNC("erf", math_func, 1, 1, MF_ERF),
   NUMMATHFUNC("erfc", math_func, 1, 1, MF_ERFC),
   NUMMATHFUNC("exp", math_func, 1, 1, MF_EXP),
@@ -157,7 +157,9 @@ static struct mathfunc mftab[] = {
   NUMMATHFUNC("nextafter", math_func, 2, 2, MF_NEXTAFTER),
   NUMMATHFUNC("rint", math_func, 1, 1, MF_RINT),
   NUMMATHFUNC("scalb", math_func, 2, 2, MF_SCALB | TFLAG(TF_INT2)),
+#ifdef HAVE_SIGNGAM
   NUMMATHFUNC("signgam", math_func, 0, 0, MF_SIGNGAM | TFLAG(TF_NOASS)),
+#endif
   NUMMATHFUNC("sin", math_func, 1, 1, MF_SIN),
   NUMMATHFUNC("sinh", math_func, 1, 1, MF_SINH),
   NUMMATHFUNC("sqrt", math_func, 1, 1, MF_SQRT | BFLAG(BF_NONNEG)),
@@ -296,10 +298,6 @@ math_func(char *name, int argc, mnumber *argv, int id)
       retd = cosh(argd);
       break;
 
-  case MF_DREM:
-      retd = drem(argd, argd2);
-      break;
-
   case MF_ERF:
       retd = erf(argd);
       break;
@@ -398,10 +396,12 @@ math_func(char *name, int argc, mnumber *argv, int id)
       retd = scalb(argd, argi);
       break;
 
+#ifdef HAVE_SIGNGAM
   case MF_SIGNGAM:
       ret.type = MN_INTEGER;
       ret.u.l = signgam;
       break;
+#endif
 
   case MF_SIN:
       retd = sin(argd);
@@ -450,23 +450,21 @@ math_func(char *name, int argc, mnumber *argv, int id)
 
 /**/
 int
-setup_mathfunc(Module m)
+setup_(Module m)
 {
     return 0;
 }
 
 /**/
 int
-boot_mathfunc(Module m)
+boot_(Module m)
 {
     return !addmathfuncs(m->nam, mftab, sizeof(mftab)/sizeof(*mftab));
 }
 
-#ifdef MODULE
-
 /**/
 int
-cleanup_mathfunc(Module m)
+cleanup_(Module m)
 {
     deletemathfuncs(m->nam, mftab, sizeof(mftab)/sizeof(*mftab));
     return 0;
@@ -474,9 +472,7 @@ cleanup_mathfunc(Module m)
 
 /**/
 int
-finish_mathfunc(Module m)
+finish_(Module m)
 {
     return 0;
 }
-
-#endif
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index 1aa527953..33632fcda 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -50,10 +50,20 @@ union zftp_sockaddr;
 struct zftp_session;
 typedef struct zftp_session *Zftp_session;
 
+/*
+ * We need to include the zsh headers later to avoid clashes with
+ * the definitions on some systems, however we need the configuration
+ * file to decide whether we can include netinet/in_systm.h, which
+ * doesn't exist on cygwin.
+ */
+#include "../../config.h"
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
-#include <netinet/in_systm.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <arpa/inet.h>
diff --git a/Src/pattern.c b/Src/pattern.c
index d0241dd12..1ebcfd401 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -631,7 +631,7 @@ static long
 patcompbranch(int *flagp)
 {
     long chain, latest, starter;
-    int flags;
+    int flags = 0;
 
     *flagp = P_PURESTR;