From 36cc76505c756e09e99eccd15bf28b679cb5b676 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 23 Feb 2012 13:56:14 +0000 Subject: [PATCH] Use wxStrnicmp() instead of strncasecmp() in wxGTK code. This fixes compilation under Windows where strncasecmp() is not available -- but portable wxStrnicmp() always is. Closes #14036. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textctrl.cpp | 2 +- src/unix/fontutil.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 8a39558799..6a6b14820e 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -403,7 +403,7 @@ au_check_word( GtkTextIter *s, GtkTextIter *e ) for( n = 0; n < WXSIZEOF(URIPrefixes); ++n ) { prefix_len = strlen(URIPrefixes[n]); - if((len > prefix_len) && !strncasecmp(text, URIPrefixes[n], prefix_len)) + if((len > prefix_len) && !wxStrnicmp(text, URIPrefixes[n], prefix_len)) break; } diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 8ed33684fd..44f681f2ae 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -159,9 +159,9 @@ wxFontFamily wxNativeFontInfo::GetFamily() const // Check for some common fonts, to salvage what we can from the current // win32 centric wxFont API: - if (strncasecmp( family_text, "monospace", 9 ) == 0) + if (wxStrnicmp( family_text, "monospace", 9 ) == 0) ret = wxFONTFAMILY_TELETYPE; // begins with "Monospace" - else if (strncasecmp( family_text, "courier", 7 ) == 0) + else if (wxStrnicmp( family_text, "courier", 7 ) == 0) ret = wxFONTFAMILY_TELETYPE; // begins with "Courier" #if defined(__WXGTK20__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE) else @@ -209,9 +209,9 @@ wxFontFamily wxNativeFontInfo::GetFamily() const ret = wxFONTFAMILY_SWISS; // contains "Sans" else if (strstr( family_text, "serif" ) != NULL || strstr( family_text, "Serif" ) != NULL) ret = wxFONTFAMILY_ROMAN; // contains "Serif" - else if (strncasecmp( family_text, "times", 5 ) == 0) + else if (wxStrnicmp( family_text, "times", 5 ) == 0) ret = wxFONTFAMILY_ROMAN; // begins with "Times" - else if (strncasecmp( family_text, "old", 3 ) == 0) + else if (wxStrnicmp( family_text, "old", 3 ) == 0) ret = wxFONTFAMILY_DECORATIVE; // begins with "Old" - "Old English", "Old Town" } -- 2.45.2