Skip to content

Commit db9e03f

Browse files
committed
Removed useless builderCtx field SketchSourceAfterCppPreprocessing
1 parent d39e061 commit db9e03f

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
@@ -57,11 +57,10 @@ func PreprocessSketchWithCtags(ctx *types.Context) error {
5757
if src, err := targetFilePath.ReadFile(); err != nil {
5858
return err
5959
} else {
60-
ctx.SketchSourceAfterCppPreprocessing = bldr.FilterSketchSource(ctx.Sketch, bytes.NewReader(src), false)
61-
}
62-
63-
if err := targetFilePath.WriteFile([]byte(ctx.SketchSourceAfterCppPreprocessing)); err != nil {
64-
return err
60+
filteredSource := bldr.FilterSketchSource(ctx.Sketch, bytes.NewReader(src), false)
61+
if err := targetFilePath.WriteFile([]byte(filteredSource)); err != nil {
62+
return err
63+
}
6564
}
6665

6766
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
@@ -107,8 +107,6 @@ type Context struct {
107107
// Arduino sketch (.ino) to C++ (.cpp) conversion steps:
108108
// 1. Concatenate *.ino files into a single merged source file -> SketchSourceMerged
109109
SketchSourceMerged string
110-
// 2. Run a pass of C++ preprocessor to remove macro definitions and ifdef-ed code -> SketchSourceAfterCppPreprocessing
111-
SketchSourceAfterCppPreprocessing string
112110
// 3. Do the Arduino preprocessing of the sketch (add missing prototypes) -> SketchSourceAfterArduinoPreprocessing
113111
SketchSourceAfterArduinoPreprocessing string
114112

0 commit comments

Comments
 (0)