Mercurial
comparison third_party/libuv/m4/as_case.m4 @ 173:827c6ac504cd hg-web
Merged in default here.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 19 Jan 2026 18:59:10 -0800 |
| parents | 948de3f54cea |
| children |
comparison
equal
deleted
inserted
replaced
| 151:c033667da5f9 | 173:827c6ac504cd |
|---|---|
| 1 # AS_CASE(WORD, [PATTERN1], [IF-MATCHED1]...[DEFAULT]) | |
| 2 # ---------------------------------------------------- | |
| 3 # Expand into | |
| 4 # | case WORD in | |
| 5 # | PATTERN1) IF-MATCHED1 ;; | |
| 6 # | ... | |
| 7 # | *) DEFAULT ;; | |
| 8 # | esac | |
| 9 m4_define([_AS_CASE], | |
| 10 [m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])], | |
| 11 [$#], 1, [ *) $1 ;;], | |
| 12 [$#], 2, [ $1) m4_default([$2], [:]) ;;], | |
| 13 [ $1) m4_default([$2], [:]) ;; | |
| 14 $0(m4_shiftn(2, $@))])dnl | |
| 15 ]) | |
| 16 m4_defun([AS_CASE], | |
| 17 [m4_ifval([$2$3], | |
| 18 [case $1 in | |
| 19 _AS_CASE(m4_shift($@)) | |
| 20 esac])]) | |
| 21 |