Skip to content

Commit 4481208

Browse files
committed
Make use of gperf-3.0.
1 parent 846668c commit 4481208

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2003-05-16 Bruno Haible <bruno@clisp.org>
2+
3+
* lib/genaliases.c (main): Emit declarations for gperf-3.0.
4+
* Makefile.devel (lib/aliases.h): Remove gperf command line options;
5+
add new option "-m 10" for gperf-3.0.
6+
17
2003-05-12 Bruno Haible <bruno@clisp.org>
28

39
* m4/error.m4: Update from gettext.

Makefile.devel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,8 @@ include/iconv.h.msvc-shared : include/iconv.h.in windows/dllexport.h
169169
sed -e 's/@ICONV_CONST@/const/g' -e 's/extern \([^"]\)/extern LIBICONV_DLL_EXPORTED \1/' -e '/_LIBICONV_VERSION/r windows/dllexport.h' < $< > $@
170170

171171

172-
# We use "-7" to make a smaller table, but use "unsigned char" array indices
173-
# to avoid gcc warning.
174172
lib/aliases.h : lib/aliases.gperf
175-
$(GPERF) -t -L ANSI-C -H aliases_hash -N aliases_lookup -G -W aliases -7 -C -k '1,3-11,$$' -i 1 lib/aliases.gperf | sed -e 's/\[str/\[(unsigned char) str/' > tmp.h
173+
$(GPERF) -m 10 lib/aliases.gperf > tmp.h
176174
$(CP) tmp.h lib/aliases.h
177175
$(RM) tmp.h
178176

lib/genaliases.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 1999-2001 Free Software Foundation, Inc.
1+
/* Copyright (C) 1999-2001, 2003 Free Software Foundation, Inc.
22
This file is part of the GNU LIBICONV Library.
33
44
The GNU LIBICONV Library is free software; you can redistribute it
@@ -41,6 +41,15 @@ static void emit_encoding (const char* const* names, size_t n, const char* c_nam
4141
int main ()
4242
{
4343
printf("struct alias { const char* name; unsigned int encoding_index; };\n");
44+
printf("%%struct-type\n");
45+
printf("%%language=ANSI-C\n");
46+
printf("%%define hash-function-name aliases_hash\n");
47+
printf("%%define lookup-function-name aliases_lookup\n");
48+
printf("%%7bit\n");
49+
printf("%%readonly-tables\n");
50+
printf("%%global-table\n");
51+
printf("%%define word-array-name aliases\n");
52+
printf("%%null-strings\n");
4453
printf("%%%%\n");
4554

4655
#define DEFENCODING(xxx_names,xxx,xxx_ifuncs1,xxx_ifuncs2,xxx_ofuncs1,xxx_ofuncs2) \

0 commit comments

Comments
 (0)