summaryrefslogtreecommitdiff
path: root/lib/btrfs/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/btrfs/Makefile')
-rw-r--r--lib/btrfs/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/btrfs/Makefile b/lib/btrfs/Makefile
index b98a1b7..2c70363 100644
--- a/lib/btrfs/Makefile
+++ b/lib/btrfs/Makefile
@@ -74,10 +74,15 @@ btrfsprim/itemtype.go: btrfsitem/items.txt $(MAKEFILE_LIST)
echo '// Code generated by Make. DO NOT EDIT.'; \
echo; \
echo 'package $(@D)'; \
- echo 'import "fmt"'; \
+ echo 'import ('; \
+ echo ' "fmt"'; \
+ echo ' "math"'; \
+ echo ')'; \
echo 'type ItemType uint8'; \
echo 'const ('; \
sed -E 's,(.*)=([^:]*)(:.*)? (trivial|complex) (.*),\1_KEY ItemType=\2,' $< | uniq; \
+ echo; \
+ echo 'MAX_KEY ItemType = math.MaxUint8'; \
echo ')'; \
echo 'func (t ItemType) String() string {'; \
echo ' switch t {'; \