eal/windows: fix debug build with MinGW
authorNick Connolly <nick.connolly@mayadata.io>
Fri, 27 Nov 2020 11:07:26 +0000 (11:07 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 7 Dec 2020 19:46:33 +0000 (20:46 +0100)
commita7288328a9f5b8e89c86681b35c59ee177566bb9
tree498940c27d84362b8703d7465d33f32533f65c5c
parentde785ba0565ceb5d91d3f397606e5021efd53d84
eal/windows: fix debug build with MinGW

Compiling with MinGW in --buildtype=debug produces a redefinition
error for strncasecmp.

The root cause is that rte_os.h shouldn't be injecting POSIX definitions
into the environment.  It is the applications responsibility to decide
how to handle missing functionality.

Resolving this properly will require further work, but in the meantime
wrap all such definitions with #ifndef/#endif.  This resolves the specific
issue with strncasecmp and handles similar issues that applications may
encounter.

Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
lib/librte_eal/windows/include/rte_os.h