octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

including config.h in gui src code


From: Rik
Subject: including config.h in gui src code
Date: Thu, 30 Aug 2012 21:36:45 -0700

8/30/12

Jacob,

I was looking for inconsistencies in the Octave code base and I noticed
that the following files in the gui do not include config.h:

./libgui/src/main-window.cc
./libgui/src/m-editor/lexer-octave-gui.cc
./libgui/src/m-editor/file-editor.cc
./libgui/src/m-editor/find-dialog.cc
./libgui/src/m-editor/file-editor-tab.cc
./libgui/src/documentation-dockwidget.cc
./libgui/src/terminal-dockwidget.cc
./libgui/src/qtinfo/parser.cc
./libgui/src/octave-qt-event-listener.cc
./libgui/src/settings-dialog.cc
./libgui/src/welcome-wizard.cc
./libgui/src/workspace-view.cc
./libgui/src/files-dockwidget.cc

Normally all the C++ files start with the stanza:

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

This is included before anything else because definitions in config.h may
affect what subsequent #include statements actually import.  Do you think
it would be a good idea to include config.h in these files?

Eventually someone will get around to writing a configure test to determine
whether FindFirst from Qscintilla is the new or the old form.  In that case
configure will define some variable in config.h and there will need to be
an #ifdef in the code to use the new or the old calling form.  This will
require that config.h be included for at least that particular file so why
not do it for all of the C++ files just to be consistent?

--Rik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]