Skip to content

Commit

Permalink
Fix --no-nls compilation 1/2 -- #8802
Browse files Browse the repository at this point in the history
pbd/i18n.h MUST NEVER be included from header files and always be
the last include. This is because `_` is declared other headers
notably boost and some apple headers.

leading to issues like
../libs/pbd/gettext.h:58:27: error: expected unqualified-id before ‘const’
   58 | # define gettext(Msgid) ((const char *) (Msgid))
  • Loading branch information
x42 committed Sep 27, 2021
1 parent 2000bc6 commit ed3d374
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions libs/ardour/triggerbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "ardour/triggerbox.h"
#include "ardour/types_convert.h"

#include "pbd/i18n.h"

using namespace PBD;
using namespace ARDOUR;
using std::string;
Expand Down
3 changes: 2 additions & 1 deletion libs/fst/vst3-scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@
#define NO_OLDNAMES // no backwards compat _pid_t, conflict with w64 pthread/sched
#endif

#include "../ardour/filesystem_paths.cc"
#include "../ardour/vst3_scan.cc"
#include "../ardour/vst3_host.cc"
#include "../ardour/vst3_module.cc"

#include "../ardour/filesystem_paths.cc"

using namespace PBD;

class LogReceiver : public Receiver
Expand Down
3 changes: 2 additions & 1 deletion libs/surfaces/maschine2/canvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@

#include "pbd/compose.h"
#include "pbd/error.h"
#include "pbd/i18n.h"

#include "canvas.h"
#include "layout.h"

#include "maschine2.h"
#include "m2device.h"

#include "pbd/i18n.h"

#ifdef __APPLE__
#define Rect ArdourCanvas::Rect
#endif
Expand Down
4 changes: 2 additions & 2 deletions libs/surfaces/maschine2/maschine2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#include "pbd/compose.h"
#include "pbd/error.h"
#include "pbd/i18n.h"
#include "pbd/abstract_ui.cc" // instantiate template

#include "ardour/async_midi_port.h"
#include "ardour/audioengine.h"
Expand All @@ -44,6 +42,8 @@

#include "canvas.h"

#include "pbd/abstract_ui.cc" // instantiate template, includes i18n

using namespace ARDOUR;
using namespace PBD;
using namespace ArdourSurface;
Expand Down
4 changes: 2 additions & 2 deletions libs/surfaces/maschine2/ui_menu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include <cairomm/region.h>
#include <pangomm/layout.h>

#include "pbd/i18n.h"

#include "gtkmm2ext/colors.h"

#include "canvas/text.h"
Expand All @@ -35,6 +33,8 @@
#include "canvas.h"
#include "ui_menu.h"

#include "pbd/i18n.h"

#ifdef __APPLE__
#define Rect ArdourCanvas::Rect
#endif
Expand Down
2 changes: 2 additions & 0 deletions libs/temporal/beats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "temporal/debug.h"
#include "temporal/tempo.h"

#include "pbd/i18n.h"

using namespace PBD;
using namespace Temporal;

Expand Down
3 changes: 2 additions & 1 deletion libs/temporal/tempo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <inttypes.h>

#include "pbd/error.h"
#include "pbd/i18n.h"
#include "pbd/compose.h"
#include "pbd/enumwriter.h"
#include "pbd/failed_constructor.h"
Expand All @@ -31,6 +30,8 @@
#include "temporal/debug.h"
#include "temporal/tempo.h"

#include "pbd/i18n.h"

using namespace PBD;
using namespace Temporal;
using std::cerr;
Expand Down
3 changes: 1 addition & 2 deletions libs/temporal/temporal/tempo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <glibmm/threads.h>

#include "pbd/enum_convert.h"
#include "pbd/i18n.h"
#include "pbd/integer_division.h"
#include "pbd/memento_command.h"
#include "pbd/rcu.h"
Expand Down Expand Up @@ -810,7 +809,7 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
LIBTEMPORAL_API MementoBinder () {}
LIBTEMPORAL_API void set_state (XMLNode const & node, int version) const;
LIBTEMPORAL_API XMLNode& get_state () const { return TempoMap::use()->get_state(); }
LIBTEMPORAL_API std::string type_name() const { return X_("Temporal::TempoMap"); }
LIBTEMPORAL_API std::string type_name() const { return "Temporal::TempoMap"; }
LIBTEMPORAL_API void add_state (XMLNode*) {}
};

Expand Down
3 changes: 2 additions & 1 deletion libs/temporal/timeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
#include "pbd/enumwriter.h"
#include "pbd/error.h"
#include "pbd/compose.h"
#include "pbd/i18n.h"

#include "temporal/debug.h"
#include "temporal/timeline.h"
#include "temporal/tempo.h"

#include "pbd/i18n.h"

using namespace PBD;
using namespace Temporal;

Expand Down

0 comments on commit ed3d374

Please sign in to comment.