https://bugs.winehq.org/show_bug.cgi?id=55694
Bug ID: 55694 Summary: missing functions in winelib: _stricmp, _wcsicmp, _mbsicmp, _stricmp_l, _wcsicmp_l, _mbsicmp_l Product: Wine Version: 8.10 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winelib Assignee: wine-bugs@winehq.org Reporter: milahu@gmail.com Distribution: ---
these functions are not implemented by winelib:
_stricmp, _wcsicmp, _mbsicmp, _stricmp_l, _wcsicmp_l, _mbsicmp_l
compiler errors from g++ 12.3.0:
error: ‘_stricmp’ was not declared in this scope error: ‘_wcsicmp’ was not declared in this scope error: ‘_mbsicmp’ was not declared in this scope error: ‘_stricmp_l’ was not declared in this scope error: ‘_wcsicmp_l’ was not declared in this scope error: ‘_mbsicmp_l’ was not declared in this scope
some official reference for these functions:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/stricmp-wc...
https://bugs.winehq.org/show_bug.cgi?id=55694
--- Comment #1 from Milan Hauth milahu@gmail.com --- implementations of _stricmp and _stricmp_l
https://github.com/ojdkbuild/tools_toolchain_sdk10_1607/blob/master/Source/1...
https://github.com/search?q=path%3A**%2Fstricmp.cpp&type=code
extern "C" int __cdecl _stricmp ( const char * dst, const char * src )
extern "C" int __cdecl _stricmp_l ( const char * dst, const char * src, _locale_t plocinfo )
implementations of _wcsicmp and _wcsicmp_l
https://github.com/ojdkbuild/tools_toolchain_sdk10_1607/blob/master/Source/1...
https://github.com/search?q=path%3A**%2Fwcsicmp.cpp&type=code
extern "C" int __cdecl _wcsicmp ( const wchar_t * dst, const wchar_t * src )
extern "C" int __cdecl _wcsicmp_l ( const wchar_t * dst, const wchar_t * src, _locale_t plocinfo )
implementations of _mbsicmp and _mbsicmp_l
https://github.com/ojdkbuild/tools_toolchain_sdk10_1607/blob/master/Source/1...
https://github.com/search?q=path%3A**%2Fmbsicmp.cpp&type=code
extern "C" int (__cdecl _mbsicmp)( const unsigned char *s1, const unsigned char *s2 )
extern "C" int __cdecl _mbsicmp_l( const unsigned char *s1, const unsigned char *s2, _locale_t plocinfo )
https://bugs.winehq.org/show_bug.cgi?id=55694
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #2 from Zeb Figura z.figura12@gmail.com --- All of those funcitons are implemented by Wine. Did you actually remember to include string.h and mbstring.h?
The locale versions are missing from our headers, though, but they are implemented.
https://bugs.winehq.org/show_bug.cgi?id=55694
--- Comment #3 from Milan Hauth milahu@gmail.com --- yes, i have included string.h
still, wineg++ says "error: ‘_stricmp’ was not declared" etc
#include <string.h>
// fatal error: mbstring.h: No such file or directory //#include <mbstring.h>
// fatal error: wcstring.h: No such file or directory //#include <wcstring.h>
// fatal error: stricmp.h: No such file or directory //#include <stricmp.h>
int main() { if (_stricmp("asdf", "asdf") == 0) return 1; if (_wcsicmp("asdf", "asdf") == 0) return 1; if (_mbsicmp("asdf", "asdf") == 0) return 1; if (_stricmp_l("asdf", "asdf") == 0) return 1; if (_wcsicmp_l("asdf", "asdf") == 0) return 1; if (_mbsicmp_l("asdf", "asdf") == 0) return 1; return 0; }
https://bugs.winehq.org/show_bug.cgi?id=55694
--- Comment #4 from Milan Hauth milahu@gmail.com ---
The locale versions are missing from our headers, though, but they are implemented.
problem is, "winemaker . && make" includes the wrong string.h
this works:
wineg++ -c -o main main.cpp -Iwine-8.10/include/wine/msvcrt
now i only get warnings like
wine-8.10/include/wine/msvcrt/corecrt_malloc.h:29:25: warning: declaration of ‘void* calloc(size_t, size_t)’ conflicts with built-in declaration ‘void* calloc(long unsigned int, long unsigned int)’ [-Wbuiltin-declaration-mismatch]
#ifdef __WINE_STRING_H #pragma message "before include string.h: __WINE_STRING_H is defined" #else #pragma message "before include string.h: __WINE_STRING_H is not defined" #endif
#include <string.h> #include <mbstring.h>
#ifdef __WINE_STRING_H #pragma message "after include string.h: __WINE_STRING_H is defined" #else #pragma message "after include string.h: __WINE_STRING_H is not defined" #endif
//typedef locale_t _locale_t;
/* // this is in string.h of wine extern "C" int __cdecl _stricmp (const char*, const char*); extern "C" int __cdecl _wcsicmp (const wchar_t*, const wchar_t*);
// this is in mbstring.h of wine extern "C" int (__cdecl _mbsicmp)(const unsigned char*, const unsigned char*); */
// this should be in string.h of wine extern "C" int __cdecl _stricmp_l (const char*, const char*, _locale_t); extern "C" int __cdecl _wcsicmp_l (const wchar_t*, const wchar_t*, _locale_t);
// this should be in mbstring.h of wine extern "C" int __cdecl _mbsicmp_l(const unsigned char*, const unsigned char*, _locale_t);
int main() { // https://en.cppreference.com/w/cpp/language/string_literal char str[] = "abc"; // usually, wchar stores utf16 strings wchar_t w_str[] = L"abc"; // https://en.cppreference.com/w/cpp/language/aggregate_initialization#Characte... unsigned char u8_str[] = "abc";
_locale_t* some_locale = NULL;
if (_stricmp(str, str) == 0) return 1; if (_wcsicmp(w_str, w_str) == 0) return 1; if (_mbsicmp(u8_str, u8_str) == 0) return 1;
if (_stricmp_l(str, str, *some_locale) == 0) return 1; if (_wcsicmp_l(w_str, w_str, *some_locale) == 0) return 1; if (_mbsicmp_l(u8_str, u8_str, *some_locale) == 0) return 1;
return 0; }