diff options
author | Vladislav Vaintroub <wlad@sun.com> | 2010-07-25 19:30:18 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@sun.com> | 2010-07-25 19:30:18 +0200 |
commit | 568c26631c6d5551ab2c3c5c702e1490b730c00b (patch) | |
tree | ce3ef507ab2616316faa7301c2b622609ac6c846 /sql/gen_lex_hash.cc | |
parent | 212b26d1089cfb491f62cae68097d5cc66e97b65 (diff) | |
download | mariadb-git-568c26631c6d5551ab2c3c5c702e1490b730c00b.tar.gz |
Cleanup after bild team push.
* Fixed obvious errors (HAVE_BROKEN_PREAD is not true for on any
of systems we use, definitely not on HPUX)
* Remove other junk flags for OSX and HPUX
* Avoid checking type sizes in universal builds on OSX, again
(CMake2.8.0 fails is different architectures return different results)
* Do not compile template instantiation stuff unless
EXPLICIT_TEMPLATE_INSTANTIATION is used.
* Some cleanup (make gen_lex_hash simpler, avoid dependencies)
* Exclude some unused files from compilation (strtol.c etc)
Diffstat (limited to 'sql/gen_lex_hash.cc')
-rw-r--r-- | sql/gen_lex_hash.cc | 86 |
1 files changed, 4 insertions, 82 deletions
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc index 178b038a6cd..a9c03f7e2a7 100644 --- a/sql/gen_lex_hash.cc +++ b/sql/gen_lex_hash.cc @@ -77,34 +77,12 @@ So, we can read full search-structure as 32-bit word */ #define NO_YACC_SYMBOLS -#include "my_global.h" -#include "my_sys.h" -#include "m_string.h" -#ifndef __GNU_LIBRARY__ -#define __GNU_LIBRARY__ // Skip warnings in getopt.h -#endif -#include <my_getopt.h> +#include <my_global.h> #include "mysql_version.h" #include "lex.h" - -static char default_dbug_option[]= "d:t:o,/tmp/gen_lex_hash.trace"; -static char *dbug_option= default_dbug_option; - -struct my_option my_long_options[] = -{ -#ifdef DBUG_OFF - {"debug", '#', "This is a non-debug version. Catch this and exit", - 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#else - {"debug", '#', "Output debug log", &dbug_option, - &dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#endif - {"help", '?', "Display help and exit", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"version", 'V', "Output version information and exit", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} -}; +#include <stdlib.h> +#include <stdio.h> +#include <string.h> struct hash_lex_struct { @@ -341,57 +319,6 @@ void print_find_structs() } -static void usage(int version) -{ - printf("%s Ver 3.6 Distrib %s, for %s (%s)\n", - my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); - if (version) - return; - puts("Copyright (C) 2001 MySQL AB, by VVA and Monty"); - puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ -and you are welcome to modify and redistribute it under the GPL license\n"); - puts("This program generates a perfect hashing function for the sql_lex.cc"); - printf("Usage: %s [OPTIONS]\n\n", my_progname); - my_print_help(my_long_options); -} - - -extern "C" my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument __attribute__((unused))) -{ - switch(optid) { - case 'V': - usage(1); - exit(0); - case 'I': - case '?': - usage(0); - exit(0); - case '#': - DBUG_PUSH(argument ? argument : dbug_option); - break; - } - return 0; -} - - -static int get_options(int argc, char **argv) -{ - int ho_error; - - if ((ho_error= handle_options(&argc, &argv, my_long_options, get_one_option))) - exit(ho_error); - - if (argc >= 1) - { - usage(0); - exit(1); - } - return(0); -} - - int check_dup_symbols(SYMBOL *s1, SYMBOL *s2) { if (s1->length!=s2->length || strncmp(s1->name,s2->name,s1->length)) @@ -442,11 +369,7 @@ int check_duplicates() int main(int argc,char **argv) { - MY_INIT(argv[0]); - DBUG_PROCESS(argv[0]); - if (get_options(argc,(char **) argv)) - exit(1); /* Broken up to indicate that it's not advice to you, gentle reader. */ printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n"); @@ -563,7 +486,6 @@ static SYMBOL *get_hash_symbol(const char *s,\n\ }\n\ }\n" ); - my_end(0); exit(0); } |