File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -475,6 +475,9 @@ extern {
475
475
pub fn strdup ( cs : * const c_char ) -> * mut c_char ;
476
476
pub fn strpbrk ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
477
477
pub fn strstr ( cs : * const c_char , ct : * const c_char ) -> * mut c_char ;
478
+ pub fn strcasecmp ( s1 : * const c_char , s2 : * const c_char ) -> c_int ;
479
+ pub fn strncasecmp ( s1 : * const c_char , s2 : * const c_char ,
480
+ n : size_t ) -> c_int ;
478
481
pub fn strlen ( cs : * const c_char ) -> size_t ;
479
482
pub fn strnlen ( cs : * const c_char , maxlen : size_t ) -> size_t ;
480
483
#[ cfg_attr(
Original file line number Diff line number Diff line change @@ -379,6 +379,22 @@ extern {
379
379
#[ link_name = "_wsetlocale" ]
380
380
pub fn wsetlocale ( category : :: c_int ,
381
381
locale : * const wchar_t ) -> * mut wchar_t ;
382
+
383
+ cfg_if ! {
384
+ if #[ cfg( all( target_env = "gnu" ) ) ] {
385
+ pub fn strcasecmp( s1: * const c_char, s2: * const c_char) -> c_int;
386
+ pub fn strncasecmp( s1: * const c_char, s2: * const c_char,
387
+ n: size_t) -> c_int;
388
+ } else if #[ cfg( all( target_env = "msvc" ) ) ] {
389
+ #[ link_name = "_stricmp" ]
390
+ pub fn stricmp( s1: * const c_char, s2: * const c_char) -> c_int;
391
+ #[ link_name = "_strnicmp" ]
392
+ pub fn strnicmp( s1: * const c_char, s2: * const c_char,
393
+ n: size_t) -> c_int;
394
+ } else {
395
+ // Unknown target_env
396
+ }
397
+ }
382
398
}
383
399
384
400
cfg_if ! {
You can’t perform that action at this time.
0 commit comments