r18322: fixed a compilation problem on AIX caused by lex not putting config.h
authorAndrew Tridgell <tridge@samba.org>
Sun, 10 Sep 2006 10:02:10 +0000 (10:02 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:18:08 +0000 (14:18 -0500)
first. That leads to a conflicting define for lseek() due to
_LARGE_FILES being defined after standards headers are included

source/heimdal/lib/asn1/lex.c
source/heimdal/lib/com_err/lex.c
source/script/lex_compile.sh

index 37309ba0aac3d3451bca427af38c59d78ad1478d..70e893197d930a8faa7d059fea10a01c67386627 100644 (file)
@@ -1,3 +1,4 @@
+#include "config.h"
 
 #line 3 "lex.yy.c"
 
@@ -1905,7 +1906,7 @@ static int yy_get_next_buffer (void)
 
                /* Read in more data. */
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-                       (yy_n_chars), num_to_read );
+                       (yy_n_chars), (size_t) num_to_read );
 
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
                }
index d5d6b20a8daf47a9d71548e2b4d95696a73bfd2e..4697d0a3fd64c23110eddb561dee22f07e84e351 100644 (file)
@@ -1,3 +1,4 @@
+#include "config.h"
 
 #line 3 "lex.yy.c"
 
index f33a7f0fbaf0bf8e332a4eb1f5833d3cb7b27b25..064bf89bea22474cc43780f22e76e48314c4e090 100755 (executable)
@@ -19,7 +19,9 @@ fi
 TOP=`pwd`
 if cd $dir && $LEX $file; then
        if [ -r $base.yy.c ];then
-               sed '/^#/ s|$base.yy\.c|$DEST|' $base.yy.c > $base.c
+               # we must guarantee that config.h comes first
+               echo "#include \"config.h\"" > $base.c
+               sed '/^#/ s|$base.yy\.c|$DEST|' $base.yy.c >> $base.c
                rm -f $base.yy.c
        fi
 fi