From 88e810624c68f35f1d1adb2f7738bea3318b6fb4 Mon Sep 17 00:00:00 2001 From: Wiimm Date: Mon, 27 Jul 2020 09:47:16 +0200 Subject: r8226: test mac build: replacement for memrchr() --- project/src/wtest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'project/src/wtest.c') diff --git a/project/src/wtest.c b/project/src/wtest.c index 5f146ac..38e2960 100644 --- a/project/src/wtest.c +++ b/project/src/wtest.c @@ -3684,6 +3684,18 @@ const gobj_cond_ref_t * FindConditionRef2 ( u16 ref_id ) static enumError develop ( int argc, char ** argv ) { #if 1 + static const char text[] = "abc/def/ghi\0jkl/mno/pqr"; + uint i; + for ( i = 0; i < sizeof(text); i++ ) + { + ccp res = memrchr(text,'/',i); + ccp dc = dc_memrchr(text,'/',i); + printf(" %3u: %3zd %3zd%s\n", + i, res ? res-text : -1, dc ? dc-text : -1, + res == dc ? "" : " DIFFER!" ); + } + + #elif 1 static const u16 tab[] = { 0x1000,0x103f, 0x1900,0x193f, 0 }; const u16 *ptr; -- cgit v1.3.1