Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8445fee

Browse files
committedApr 26, 2023
Removed useless builderCtx field SketchSourceAfterCppPreprocessing
1 parent 05e88a8 commit 8445fee

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed
 

‎legacy/builder/container_add_prototypes.go

+4-5
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

-2
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)
Please sign in to comment.