Skip to content

Commit 0f77b62

Browse files
committed
Removed useless builderCtx field SketchSourceAfterCppPreprocessing
1 parent 9794f6d commit 0f77b62

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

legacy/builder/container_add_prototypes.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ func PreprocessSketchWithCtags(ctx *types.Context) error {
6363
if src, err := targetFilePath.ReadFile(); err != nil {
6464
return err
6565
} else {
66-
ctx.SketchSourceAfterCppPreprocessing = filterSketchSource(ctx.Sketch, bytes.NewReader(src), false)
67-
}
68-
69-
if err := targetFilePath.WriteFile([]byte(ctx.SketchSourceAfterCppPreprocessing)); err != nil {
70-
return err
66+
filteredSource := filterSketchSource(ctx.Sketch, bytes.NewReader(src), false)
67+
if err := targetFilePath.WriteFile([]byte(filteredSource)); err != nil {
68+
return err
69+
}
7170
}
7271

7372
sketchCpp := ctx.SketchBuildPath.Join(fmt.Sprintf("%s.cpp", ctx.Sketch.MainFile.Base()))

legacy/builder/types/context.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ type Context struct {
104104
// Arduino sketch (.ino) to C++ (.cpp) conversion steps:
105105
// 1. Concatenate *.ino files into a single merged source file -> SketchSourceMerged
106106
SketchSourceMerged string
107-
// 2. Run a pass of C++ preprocessor to remove macro definitions and ifdef-ed code -> SketchSourceAfterCppPreprocessing
108-
SketchSourceAfterCppPreprocessing string
109107
// 3. Do the Arduino preprocessing of the sketch (add missing prototypes) -> SketchSourceAfterArduinoPreprocessing
110108
SketchSourceAfterArduinoPreprocessing string
111109

0 commit comments

Comments
 (0)