From 0cc16b8d1da61c0bfb8743c8b68888b0ba73d4bb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 15 Mar 2023 21:38:56 -0600 Subject: btrfsprim: Add "max" constants for ObjID, ItemType, and offset --- lib/btrfs/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/btrfs/Makefile') 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 {'; \ -- cgit v1.2.3-2-g168b