Skip to content

Commit 6a5d7c0

Browse files
vitor1001guidotack
authored andcommitted
Add include headers in files using symbols defined by them.
Those still compile in most environments since the symbols get imported transitively, but relying on that is considered a bad practice. It is also necessary to compile MiniZinc with Bazel.
1 parent e852bbe commit 6a5d7c0

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

include/minizinc/htmlprinter.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <utility>
1616
#include <vector>
1717

18+
#include <minizinc/flatten_internal.hh>
19+
1820
namespace MiniZinc {
1921

2022
class Model;

include/minizinc/statistics.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111

1212
#pragma once
1313

14+
#include <minizinc/ast.hh>
15+
#include <minizinc/prettyprinter.hh>
1416
#include <minizinc/warning.hh>
1517

18+
#include <ios>
1619
#include <iterator>
1720
#include <memory>
1821

include/minizinc/support/regex.hh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111

1212
#pragma once
1313

14-
#ifdef HAS_GECODE
15-
1614
// Regex Parser Requirements
1715
#include <minizinc/astmap.hh>
1816
#include <minizinc/aststring.hh>
17+
#include <minizinc/config.hh>
1918
#include <minizinc/values.hh>
2019

2120
#include <memory>
2221
#include <set>
2322

23+
#ifdef HAS_GECODE
24+
2425
#include <gecode/minimodel.hh>
2526
#undef ERROR
2627

lib/parser.yxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* License, v. 2.0. If a copy of the MPL was not distributed with this
1010
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1111

12+
%code requires {
13+
#include <minizinc/ast.hh>
14+
}
15+
1216
%define api.pure
1317

1418
%parse-param {void *parm}
@@ -32,6 +36,8 @@ namespace MiniZinc{ class ParserLocation; }
3236
#define YYMAXDEPTH 10000
3337
#define YYINITDEPTH 10000
3438

39+
#include <vector>
40+
3541
#include <minizinc/parser.hh>
3642
#include <minizinc/file_utils.hh>
3743

0 commit comments

Comments
 (0)