Skip to content

Commit 818b0e7

Browse files
committed
Removed DebugPreprocessor from builder ctx
1 parent 3408445 commit 818b0e7

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Diff for: legacy/builder/container_add_prototypes.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ func PreprocessSketchWithCtags(ctx *types.Context) error {
7373
if err != nil {
7474
return err
7575
}
76-
ctx.SketchSourceAfterArduinoPreprocessing = PrototypesAdder(
77-
ctx.Sketch, ctx.SketchSourceMerged, ctagsStdout, ctx.LineOffset, ctx.DebugPreprocessor)
76+
ctx.SketchSourceAfterArduinoPreprocessing = PrototypesAdder(ctx.Sketch, ctx.SketchSourceMerged, ctagsStdout, ctx.LineOffset)
7877

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

Diff for: legacy/builder/prototypes_adder.go

+4-2
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]

Diff for: legacy/builder/test/try_build_of_problematic_sketch_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ func TestTryBuild042(t *testing.T) {
202202
}
203203

204204
func makeDefaultContext() *types.Context {
205+
builder.DebugPreprocessor = true
205206
return &types.Context{
206207
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "downloaded_board_manager_stuff"),
207208
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
208209
BuiltInLibrariesDirs: paths.New("downloaded_libraries"),
209210
OtherLibrariesDirs: paths.NewPathList("libraries"),
210211
Verbose: true,
211-
DebugPreprocessor: true,
212212
}
213213
}
214214

Diff for: legacy/builder/types/context.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ type Context struct {
121121
LineOffset int
122122

123123
// Verbosity settings
124-
Verbose bool
125-
DebugPreprocessor bool
124+
Verbose bool
126125

127126
// Dry run, only create progress map
128127
Progress ProgressStruct

0 commit comments

Comments
 (0)