2022-08-18  Juan Manuel Guerrero <juan.guerrero@gmx.de>


	* frontend/input.c: [__DJGPP__]: Include required DJGPP specific
	headers.
	(wav_open_read) [__DJGPP__]: For DJGPP, reenable SIGINT and SIGQUIT
	signals if stdin and/or stdout is connected to console and has been
	switched into binary mode.

	* frontend/mp4write.c: ISO C does not allow extra `;' outside of
	a function.

	* libfaac/blockswitch.h: Pacify compiler.





diff -aprNU1 faac-1.30.orig/frontend/input.c faac-1.30/frontend/input.c
--- faac-1.30.orig/frontend/input.c	2019-10-16 10:52:18 +0000
+++ faac-1.30/frontend/input.c	2022-08-19 00:55:58 +0000
@@ -32,2 +32,7 @@
 #include <fcntl.h>
+#elif defined(__DJGPP__)
+# include <io.h>           /* declares setmode() */
+# include <fcntl.h>        /* defines O_BINARY */
+# include <unistd.h>       /* declares isatty() */
+# include <sys/exceptn.h>  /* declares __djgpp_set_ctrl_c() */
 #endif
@@ -166,2 +171,17 @@ pcmfile_t *wav_open_read(const char *nam
     _setmode(_fileno(stdin), O_BINARY);
+#elif defined __DJGPP__
+    /* Putting stdin/stdout in binary mode if it is connected to
+       the console, would make it impossible for the user to
+       interrupt the program through Ctrl-C or Ctrl-Break.  */
+
+    /* This is DJGPP-specific.  By default, switching console
+       to binary mode disables SIGINT and SIGQUIT.  But we want
+       terminal reads to be interruptible.  */
+
+    {
+      int fd = fileno(stdin);
+      setmode(fd, O_BINARY);
+      if (isatty(fd))
+        __djgpp_set_ctrl_c(1);
+    }
 #endif
diff -aprNU1 faac-1.30.orig/frontend/mp4write.c faac-1.30/frontend/mp4write.c
--- faac-1.30.orig/frontend/mp4write.c	2019-10-16 10:52:18 +0000
+++ faac-1.30/frontend/mp4write.c	2022-08-19 00:57:18 +0000
@@ -196,3 +196,3 @@ static int mvhdout(void)
     return size;
-};
+}
 
@@ -247,3 +247,3 @@ static int tkhdout(void)
     return size;
-};
+}
 
@@ -269,3 +269,3 @@ static int mdhdout(void)
     return size;
-};
+}
 
@@ -291,3 +291,3 @@ static int hdlr1out(void)
     return size;
-};
+}
 
@@ -305,3 +305,3 @@ static int smhdout(void)
     return size;
-};
+}
 
@@ -317,3 +317,3 @@ static int drefout(void)
     return size;
-};
+}
 
@@ -326,3 +326,3 @@ static int urlout(void)
     return size;
-};
+}
 
@@ -338,3 +338,3 @@ static int stsdout(void)
     return size;
-};
+}
 
@@ -618,3 +618,3 @@ static int hdlr2out(void)
     return size;
-};
+}
 
@@ -698,3 +698,3 @@ static int ilstout(void)
     return size;
-};
+}
 
diff -aprNU1 faac-1.30.orig/libfaac/blockswitch.h faac-1.30/libfaac/blockswitch.h
--- faac-1.30.orig/libfaac/blockswitch.h	2019-10-16 10:52:18 +0000
+++ faac-1.30/libfaac/blockswitch.h	2022-08-19 00:55:58 +0000
@@ -83,2 +83,3 @@ extern psymodel_t psymodel2;
 
-#endif /* PSYCH_H */
\ No newline at end of file
+#endif /* PSYCH_H */
+
