Skip to content

Commit

Permalink
Un-nest check_ver macro
Browse files Browse the repository at this point in the history
RGBDS 0.4.2 made those invalid
  • Loading branch information
ISSOtm committed Dec 29, 2020
1 parent 0937be7 commit c628309
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions structs.asm
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ TMP equs STRSUB("{\1}", 2, STRLEN("{\1}") - 1)
ENDC
ENDM

check_ver: MACRO
IF \1 != \4 || \2 > \5 || \3 > \6
PURGE EXPECTED_VERSION
ENDC
ENDM

; rgbds_structs_version version_string
; Call with the expected version string to ensure you're using a compatible version
; Example: rgbds_structs_version 1.0.0
rgbds_structs_version: MACRO
CURRENT_VERSION equs "1,2,1"
CURRENT_VERSION equs "1,3,0"
EXPECTED_VERSION equs "\1"
strreplace EXPECTED_VERSION, ".", "\,"

This comment has been minimized.

Copy link
@Rangi42

Rangi42 Dec 29, 2020

Contributor

This (the only usage of strreplace) is no longer necessary without version dots.

This comment has been minimized.

Copy link
@ISSOtm

ISSOtm Dec 29, 2020

Author Owner

The argument is still expected to be X.Y.Z instead of X,Y,Z

check_ver: MACRO
IF \1 != \4 || \2 > \5 || \3 > \6
PURGE EXPECTED_VERSION
ENDC
ENDM

CHECK_VER_CALL equs "check_ver {EXPECTED_VERSION},{CURRENT_VERSION}"
CHECK_VER_CALL
Expand Down

0 comments on commit c628309

Please sign in to comment.