[liblouis-liblouisxml] Remove #include "config.h" from liblouis.h

  • From: Christian Egli <christian.egli@xxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Wed, 11 Nov 2009 17:22:38 +0100

Hi

Yuemei Sun reported a problem a while ago
(//www.freelists.org/post/liblouis-liblouisxml/Releases-are-out,7)
that liblouisxml would report the wrong version number. When debugging
this problem I found the following:

The header file of liblouis currently includes a file named config.h
(before the gnulib work this was called louiscfg.h). This file is
generated at configure time and contains a lot of definitions such as
for example "#define WIDECHAR_SIZE 2" which determines the size of the
widechar type. Depending on the options that the user passes
to ./configure this definition is changed. That's why it has to be
included in liblouis.h because there the widechar type is defined
conditionally based on WIDECHAR_SIZE. Now, the config.h file also
contains a lot of other defines such as PACKAGE_NAME and
PACKAGE_VERSION. Since these symbols are then exported through
liblouis.h they are also visible in liblouisxml where liblouis.h is
included. This is the reason that liblouisxml reports the wrong version
number.

To fix this I propose that liblouis.h should no longer import config.h.
Instead there should be a liblouis.h.in which is adapted by configure to
define the widechar type based on the options passed to ./configure.
Everything should behave exactly as before with the exception that none
the symbol definitions from config.h are exported any more.

I have a patch that fixes this locally. Should I go ahead and check it
in?

Thanks
Christian
-- 
Christian Egli
Swiss Library for the Blind and Visually Impaired
Grubenstrasse 12, CH-8045 Zürich, Switzerland

For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts: