]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/movewindow.c
ncurses 6.1 - patch 20180303
[ncurses.git] / test / movewindow.c
index d1e8dee8b7848f739c09ec733e4ae3f679b177ec..b8e9e049602dcf0298a27ae3c60a418a6e20e44d 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: movewindow.c,v 1.42 2017/04/15 18:37:42 tom Exp $
+ * $Id: movewindow.c,v 1.46 2017/12/23 21:36:59 tom Exp $
  *
  * Demonstrate move functions for windows and derived windows from the curses
  * library.
@@ -45,14 +45,16 @@ TODO:
  */
 
 #include <test.priv.h>
-#include <stdarg.h>
+
+#if HAVE_MVDERWIN && HAVE_MVWIN
+
 #include <popup_msg.h>
 
 #ifdef HAVE_XCURSES
 #undef derwin
 #endif
 
-#ifdef NCURSES_VERSION
+#if defined(NCURSES_VERSION) || defined(PDCURSES)
 #define CONST_FMT const
 #else
 #define CONST_FMT              /* nothing */
@@ -191,6 +193,7 @@ selectcell(WINDOW *parent,
            moved = TRUE;
            break;
        case QUIT:
+           /* FALLTHRU */
        case ESCAPE:
            return ((PAIR *) 0);
 #ifdef NCURSES_MOUSE_VERSION
@@ -212,8 +215,8 @@ selectcell(WINDOW *parent,
                    break;
                }
            }
-           /* FALLTHRU */
 #endif
+           /* FALLTHRU */
        default:
            res.y = uli + i;
            res.x = ulj + j;
@@ -766,3 +769,11 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 #endif
     ExitProgram(EXIT_SUCCESS);
 }
+#else
+int
+main(void)
+{
+    printf("This program requires the curses mvderwin and mvwin functions\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif