Skip to content

Commit

Permalink
more compat
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck committed Aug 31, 2024
1 parent 398bc65 commit 8dfbc17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stew/arraybuf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ type ArrayBuf*[N: static int, T = byte] = object
## instantiation (using an `array`).
buf*: array[N, T]

when N <= int(uint8.high):
when sizeof(int) > sizeof(uint8) and N <= int(uint8.high):
n*: uint8
elif N <= int(uint16.high):
elif sizeof(int) > sizeof(uint16) and N <= int(uint16.high):
n*: uint16
elif sizeof(int) > 4 and N <= int(uint32.high):
elif sizeof(int) > sizeof(uint32) and N <= int(uint32.high):
n*: uint32
else:
n*: int
Expand Down

0 comments on commit 8dfbc17

Please sign in to comment.