]> granicus.if.org Git - nethack/commitdiff
enable USE_WIN_IOCTL code unless explicitly avoided
authornhmall <nhmall@nethack.org>
Sat, 3 Mar 2018 17:58:53 +0000 (12:58 -0500)
committernhmall <nhmall@nethack.org>
Sat, 3 Mar 2018 17:58:53 +0000 (12:58 -0500)
 Changes to be committed:
modified:   doc/fixes36.1
modified:   include/unixconf.h
modified:   sys/share/ioctl.c

github pull request #19 made reference to resulting code behaviour
being better when windows were resized when USE_WIN_IOCTL was defined.

The logic for including the necessary enabling code in the build in
sys/share/ioctl.c was an explicit "opt-in" strategy, so anything not
deliberately and explicitly listed was not able to take advantae
of the potentially useful code. The need to add #defines to that
list would have been perpetual as new platforms came online, and
unnecessarily restrictive for everything else.

This switches the logic to include the code by default now,
and thus
unless there is an explicit "opt-out" by uncommenting
AVOID_WIN_IOCTL in include/unixconf.h

Some platforms, and we have no way of knowing which ones, may have
to ensure that AVOID_WIN_IOCTL is #define'd.

doc/fixes36.1
include/unixconf.h
sys/share/ioctl.c

index 02bded2afdb10a29698f1c29aa699af2b7bc7225..c282bdc5846dc3d4c7b9153c41395a923dd977f6 100644 (file)
@@ -635,6 +635,8 @@ unix: race condition with parallel make: src/Makefile might start building
 unix: Makefile.{src,utl} ignored CPPFLAGS which is expanded by the default .c
        rule by GNU make so if user had a value for that in the environment,
        it would apply to some files but not others; explicitly override it
+unix: enable code guarded by USE_WIN_IOCTL by default unless prevented by
+       uncommenting #define AVOID_WIN_IOCTL in include/unixconf.h
 win32gui: getversionstring() was overflowing the provided Help About buffer
 win32gui: guard against buffer overflow in in mswin_getlin()
 win32gui: handle menu_color attribute
index 88e309d55df1affccb1ad412cff506d8f8af5130..cec8c709aef806bdb216bfdd7ca76c06dcd3c82a 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 unixconf.h      $NHDT-Date: 1451342112 2015/12/28 22:35:12 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.25 $ */
+/* NetHack 3.6 unixconf.h      $NHDT-Date: 1520099325 2018/03/03 17:48:45 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.30 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
 #define TIMED_DELAY
 #endif
 
+/* #define AVOID_WIN_IOCTL */ /* ensure USE_WIN_IOCTL remains undefined */
+
 /*
  * If you define MAIL, then the player will be notified of new mail
  * when it arrives.  If you also define DEF_MAILREADER then this will
index 3da74b81a9ac7923f6dca00e63db9fe38d30e7f1..138d02b5c1d22af632c40ce5331a5e1e71ef72c8 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 ioctl.c $NHDT-Date: 1432512788 2015/05/25 00:13:08 $  $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */
+/* NetHack 3.6 ioctl.c $NHDT-Date: 1520099308 2018/03/03 17:48:28 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.13 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -63,9 +63,12 @@ struct termio termio;
 #include <signal.h>
 #endif
 
-#if defined(TIOCGWINSZ)                                    \
-    && (defined(BSD) || defined(ULTRIX) || defined(AIX_31) \
-        || defined(_BULL_SOURCE) || defined(SVR4))
+/* AVOID_WIN_IOCTL can be uncommented in unixconf.h
+ * to force USE_WIN_IOTCL to remain undefined,
+ * instead of the restricted explicit opt-in
+ * logic that used to be here.
+ */
+#if defined(TIOCGWINSZ) && !defined(AVOID_WIN_IOCTL)
 #define USE_WIN_IOCTL
 #include "tcap.h" /* for LI and CO */
 #endif