compiler, runtime: move constants into shared package

Use a single package for certain constants that must be the same between
the compiler and the runtime.

While just using the same values in both places works, this is much more
obvious and harder to mess up. It also avoids the need for comments
pointing to the other location the constant is defined. And having it in
code makes it possible for IDEs to analyze the source.

In the future, more such constants and maybe algorithms can be added.
This commit is contained in:
Ayke van Laethem
2024-11-15 09:09:04 +01:00
committed by Ayke
parent ac9f72be61
commit 6d4dfcf72f
7 changed files with 42 additions and 40 deletions
+1
View File
@@ -256,6 +256,7 @@ func pathsToOverride(goMinor int, needsSyscallPackage bool) map[string]bool {
"runtime/": false,
"sync/": true,
"testing/": true,
"tinygo/": false,
"unique/": false,
}