mirror of
https://github.com/mirror/tinycc.git
synced 2025-04-01 12:30:08 +08:00
Use ISO C string functions instead of obsolete BSD ones that used to be in strings.h. It allows more systems -- i.e. Windows -- to use those tests
This commit is contained in:
parent
07ca2df588
commit
8986bc8af4
@ -1,6 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@ -26,9 +25,9 @@ int main()
|
|||||||
printf("%d\n", strncmp(a, "goerg", 2) == 0);
|
printf("%d\n", strncmp(a, "goerg", 2) == 0);
|
||||||
printf("%d\n", strncmp(a, "zebra", 2) < 0);
|
printf("%d\n", strncmp(a, "zebra", 2) < 0);
|
||||||
|
|
||||||
printf("%s\n", index(a, 'o'));
|
printf("%s\n", strchr(a, 'o'));
|
||||||
printf("%s\n", rindex(a, 'l'));
|
printf("%s\n", strrchr(a, 'l'));
|
||||||
printf("%d\n", rindex(a, 'x') == NULL);
|
printf("%d\n", strrchr(a, 'x') == NULL);
|
||||||
|
|
||||||
memset(&a[1], 'r', 4);
|
memset(&a[1], 'r', 4);
|
||||||
printf("%s\n", a);
|
printf("%s\n", a);
|
||||||
|
@ -22,10 +22,6 @@ endif
|
|||||||
ifeq ($(TARGETOS),Darwin)
|
ifeq ($(TARGETOS),Darwin)
|
||||||
SKIP += 40_stdio.test
|
SKIP += 40_stdio.test
|
||||||
endif
|
endif
|
||||||
ifdef CONFIG_WIN32
|
|
||||||
SKIP += 24_math_library.test # don't have round()
|
|
||||||
SKIP += 28_strings.test # don't have r/index() / strings.h
|
|
||||||
endif
|
|
||||||
ifeq ($(ARCH),x86-64)
|
ifeq ($(ARCH),x86-64)
|
||||||
SKIP += 73_arm64.test
|
SKIP += 73_arm64.test
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user