Skip to content

Commit 57f2191

Browse files
committed
Removed DebugPreprocessor from builder ctx
1 parent a322ac9 commit 57f2191

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

legacy/builder/container_add_prototypes.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ func PreprocessSketchWithCtags(ctx *types.Context) error {
6767
if err != nil {
6868
return err
6969
}
70-
ctx.SketchSourceAfterArduinoPreprocessing = PrototypesAdder(
71-
ctx.Sketch, ctx.SketchSourceMerged, ctagsStdout, ctx.LineOffset, ctx.DebugPreprocessor)
70+
ctx.SketchSourceAfterArduinoPreprocessing = PrototypesAdder(ctx.Sketch, ctx.SketchSourceMerged, ctagsStdout, ctx.LineOffset)
7271

7372
if err := bldr.SketchSaveItemCpp(ctx.Sketch.MainFile, []byte(ctx.SketchSourceAfterArduinoPreprocessing), ctx.SketchBuildPath); err != nil {
7473
return errors.WithStack(err)

legacy/builder/prototypes_adder.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ import (
2626
"github.com/arduino/arduino-cli/legacy/builder/utils"
2727
)
2828

29-
func PrototypesAdder(sketch *sketch.Sketch, source string, ctagsStdout []byte, lineOffset int, debugOutput bool) string {
29+
var DebugPreprocessor bool
30+
31+
func PrototypesAdder(sketch *sketch.Sketch, source string, ctagsStdout []byte, lineOffset int) string {
3032
parser := &ctags.CTagsParser{}
3133
parser.Parse(ctagsStdout, sketch.MainFile)
3234
parser.FixCLinkageTagsDeclarations()
@@ -48,7 +50,7 @@ func PrototypesAdder(sketch *sketch.Sketch, source string, ctagsStdout []byte, l
4850
prototypeSection := composePrototypeSection(firstFunctionLine, prototypes)
4951
preprocessedSource := source[:firstFunctionChar] + prototypeSection + source[firstFunctionChar:]
5052

51-
if debugOutput {
53+
if DebugPreprocessor {
5254
fmt.Println("#PREPROCESSED SOURCE")
5355
prototypesRows := strings.Split(prototypeSection, "\n")
5456
prototypesRows = prototypesRows[:len(prototypesRows)-1]

legacy/builder/test/try_build_of_problematic_sketch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ func makeDefaultContext(t *testing.T) *types.Context {
214214
OtherLibrariesDirs: paths.NewPathList("libraries"),
215215
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
216216
Verbose: true,
217-
DebugPreprocessor: true,
218217
}
218+
builder.DebugPreprocessor = true
219219
buildPath := SetupBuildPath(t, ctx)
220220
defer buildPath.RemoveAll()
221221

legacy/builder/types/context.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ type Context struct {
124124
LineOffset int
125125

126126
// Verbosity settings
127-
Verbose bool
128-
DebugPreprocessor bool
127+
Verbose bool
129128

130129
// Compile optimization settings
131130
OptimizeForDebug bool

0 commit comments

Comments
 (0)