diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-15 21:38:56 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-15 21:41:00 -0600 |
commit | 0cc16b8d1da61c0bfb8743c8b68888b0ba73d4bb (patch) | |
tree | 8a210fcb602af13fc4175338fc0bda2101838e92 /lib/btrfs/Makefile | |
parent | c42e8ea5d77a39d096d97600359bd91657da2f05 (diff) |
btrfsprim: Add "max" constants for ObjID, ItemType, and offset
Diffstat (limited to 'lib/btrfs/Makefile')
-rw-r--r-- | lib/btrfs/Makefile | 7 |
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 {'; \ |