andlabs / libui

Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.
Other
10.74k stars 616 forks source link

fix warning: implicit declaration of function ‘strcasecmp’ #546

Open andy5995 opened 2 years ago

andy5995 commented 2 years ago

On gcc 11.1.0 (Manjaro), I got this warning

[58/93] Compiling C object meson-out/libui.so.0.p/unix_text.c.o
../unix/text.c: In function ‘uiprivStricmp’:
../unix/text.c:16:16: warning: implicit declaration of function
‘strcasecmp’; did you mean ‘g_strcasecmp’?
[-Wimplicit-function-declaration]
   16 |         return strcasecmp(a, b);
      |                ^~~~~~~~~~
      |                g_strcasecmp

I assume you'd want to use a g_* function here so you don't have to

Apparently g_strcasecmp is deprecated. Some extra info at https://people.gnome.org/~ryanl/glib-docs/glib-String-Utility-Functions.html#g-strcasecmp