From ce78836328e315e32e9bb64d74efa18a3d1e404d Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 27 Apr 2021 09:48:28 +0200 Subject: [PATCH] use SIZE_MAX --- modules/libcom/src/misc/epicsString.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/libcom/src/misc/epicsString.c b/modules/libcom/src/misc/epicsString.c index 2933fb48e..be6463438 100644 --- a/modules/libcom/src/misc/epicsString.c +++ b/modules/libcom/src/misc/epicsString.c @@ -23,6 +23,15 @@ #include #include +#ifndef vxWorks +#include +#else +/* VxWorks automaticaly includes stdint.h defining SIZE_MAX in 6.9 but not earlier */ +#ifndef SIZE_MAX +#define SIZE_MAX (size_t)-1 +#endif +#endif + #include "epicsAssert.h" #include "epicsStdio.h" #include "cantProceed.h" @@ -292,7 +301,7 @@ int epicsStrnGlobMatch(const char *str, size_t len, const char *pattern) } int epicsStrGlobMatch(const char *str, const char *pattern) { - return epicsStrnGlobMatch(str, (size_t)-1, pattern); + return epicsStrnGlobMatch(str, SIZE_MAX, pattern); } char * epicsStrtok_r(char *s, const char *delim, char **lasts)