diff --git a/src/testpattern/testpatterny.h b/src/testpattern/testpatterny.h
index 010e17a..986d1d7 100644
--- a/src/testpattern/testpatterny.h
+++ b/src/testpattern/testpatterny.h
@@ -36,6 +36,9 @@
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
+#ifdef PAGESIZE
+#undef PAGESIZE
+#endif
    /* Put the tokens into the symbol table, so that GDB and other debuggers
       know about them.  */
    enum yytokentype {
