From: Ben Pfaff Date: Sat, 5 Nov 2011 04:45:49 +0000 (-0700) Subject: lexer: Rename 'close' to 'destroy' in struct lex_reader_class. X-Git-Tag: v0.7.9~114 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d285151f02251f52039e903d1a1a7f2eb3beb2e;p=pspp-builds.git lexer: Rename 'close' to 'destroy' in struct lex_reader_class. This seems like a cleaner solution to the problem of Gnulib sometimes defining 'close' as a macro than to add an extra include file and a big comment. --- diff --git a/src/language/lexer/lexer.c b/src/language/lexer/lexer.c index 686aafd0..5f1cc4ba 100644 --- a/src/language/lexer/lexer.c +++ b/src/language/lexer/lexer.c @@ -1452,8 +1452,8 @@ static void lex_source_destroy (struct lex_source *src) { char *file_name = src->reader->file_name; - if (src->reader->class->close != NULL) - src->reader->class->close (src->reader); + if (src->reader->class->destroy != NULL) + src->reader->class->destroy (src->reader); free (file_name); free (src->buffer); while (!deque_is_empty (&src->deque)) diff --git a/src/language/lexer/lexer.h b/src/language/lexer/lexer.h index b35ea7f5..0a3e6c37 100644 --- a/src/language/lexer/lexer.h +++ b/src/language/lexer/lexer.h @@ -20,13 +20,6 @@ #include #include -/* The following #include avoids a potential problem when Gnulib substitutes - * for close() by putting "#define close rpl_close" into , by - * ensuring that every source file that includes this one sees the #define. - * (It would probably be better to rename the 'close' member of struct - * lex_reader_class.) */ -#include - #include "data/identifier.h" #include "data/variable.h" #include "libpspp/compiler.h" @@ -79,7 +72,7 @@ struct lex_reader_class The caller will free the 'file_name' member of READER, so the implementation should not do so. */ - void (*close) (struct lex_reader *reader); + void (*destroy) (struct lex_reader *reader); }; /* Helper functions for lex_reader. */