public: fix build on Windows

stristr doesn't exist actually
This commit is contained in:
Alibek Omarov 2024-05-03 15:30:39 +03:00
parent b0704ca5d6
commit b78e9961c6
3 changed files with 4 additions and 10 deletions

View file

@ -318,7 +318,7 @@ const char* Q_timestamp( int format )
return timestamp; return timestamp;
} }
#if !HAVE_STRCASESTR && !HAVE_STRISTR #if !HAVE_STRCASESTR
char *Q_stristr( const char *string, const char *string2 ) char *Q_stristr( const char *string, const char *string2 )
{ {
int c; int c;

View file

@ -258,21 +258,16 @@ int Q_strnicmp( const char *s1, const char *s2, size_t n );
#endif #endif
#if HAVE_STRISTR || HAVE_STRCASESTR #if HAVE_STRCASESTR
static inline char *Q_stristr( const char *s1, const char *s2 ) static inline char *Q_stristr( const char *s1, const char *s2 )
{ {
if( likely( s1 && s2 )) if( likely( s1 && s2 ))
#if HAVE_STRISTR
return (char *)stristr( s1, s2 );
#elif HAVE_STRCASESTR
return (char *)strcasestr( s1, s2 ); return (char *)strcasestr( s1, s2 );
#endif
return NULL; return NULL;
} }
#else // !HAVE_STRISTR && !HAVE_STRCASESTR #else // !HAVE_STRCASESTR
char *Q_stristr( const char *s1, const char *s2 ); char *Q_stristr( const char *s1, const char *s2 );
#endif // !HAVE_STRISTR && !HAVE_STRCASESTR #endif // !HAVE_STRCASESTR
#if HAVE_STRCHRNUL #if HAVE_STRCHRNUL
#define Q_strchrnul strchrnul #define Q_strchrnul strchrnul

View file

@ -86,7 +86,6 @@ def configure(conf):
if conf.env.DEST_OS == 'win32': if conf.env.DEST_OS == 'win32':
conf.export_define('HAVE_STRNICMP') conf.export_define('HAVE_STRNICMP')
conf.export_define('HAVE_STRICMP') conf.export_define('HAVE_STRICMP')
conf.export_define('HAVE_STRISTR')
else: else:
# TODO: multicheck for speed # TODO: multicheck for speed
def check_libc_extension(frag, msg, define): def check_libc_extension(frag, msg, define):