summaryrefslogtreecommitdiff
path: root/lib/btrfs/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-15 21:38:56 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-15 21:41:00 -0600
commit0cc16b8d1da61c0bfb8743c8b68888b0ba73d4bb (patch)
tree8a210fcb602af13fc4175338fc0bda2101838e92 /lib/btrfs/Makefile
parentc42e8ea5d77a39d096d97600359bd91657da2f05 (diff)
btrfsprim: Add "max" constants for ObjID, ItemType, and offset
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 {'; \