Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use strcasecmp() instead of stricmp() on cygwin #104

Closed
hiyuh opened this issue Sep 30, 2015 · 1 comment
Closed

use strcasecmp() instead of stricmp() on cygwin #104

hiyuh opened this issue Sep 30, 2015 · 1 comment
Labels

Comments

@hiyuh
Copy link
Contributor

hiyuh commented Sep 30, 2015

SSIA.
following is snippet from build log,

os/windows_usb.c: In function ‘get_sub_api’:
os/windows_usb.c:747:4: error: implicit declaration of function ‘stricmp’ [-Werror=implicit-function-declaration]
    if (safe_stricmp(tok, usb_api_backend[api].driver_name_list[i]) == 0) {
    ^

following is a proposed fix,

diff --git a/libusb/os/windows_usb.h b/libusb/os/windows_usb.h
index 35fd2f2..4f3de69 100644
--- a/libusb/os/windows_usb.h
+++ b/libusb/os/windows_usb.h
@@ -48,7 +48,7 @@
 #endif

 #if defined(__CYGWIN__ )
-#define _stricmp stricmp
+#define _stricmp strcasecmp
 #define _snprintf snprintf
 #define _strdup strdup
 // _beginthreadex is MSVCRT => unavailable for cygwin. Fallback to using CreateThread
@hiyuh hiyuh changed the title use strcasecmp() instead of stricmp() on cygwin. use strcasecmp() instead of stricmp() on cygwin Sep 30, 2015
@yselkowitz
Copy link

Bug and fix confirmed.

@dickens dickens closed this as completed in 3313f48 Jan 7, 2016
Seneral pushed a commit to Seneral/libusb that referenced this issue Sep 21, 2021
Cygwin does not define the latter in all versions, so this commit
uses the former POSIX function that Cygwin does provide.

Closes libusb#104

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
@mcuee mcuee added the windows label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants