← Back to team overview

kicad-developers team mailing list archive

strtok_r not detected properly

 

When building Pcbnew, I get an error message indicating that strtok_r is being redefined. The offending code is in kicad_string.h.

#ifndef HAVE_STRTOKR
// common/strtok_r.c optionally:
extern "C" char* strtok_r( char* str, const char* delim, char** nextp );
#endif

I tracked HAVE_STRTOKR to an auto detection inside PerformFeatureChecks.cmake.

check_symbol_exists( strtok_r "string.h" HAVE_STRTOKR )

Fore some reason, this check is failing even though strtok_r is defined. Presumably, the check is looking in the wrong file. I tried adjusting this line, but without success.

As a quick fix I added

#define HAVE_STRTOKR

just prior to the check in kicad_string.h.

I'm on Windows using TDM-GCC 4.8.1-3.

What is the correct check_symbol_exists() line to fix this problem?

Thanks,
David


Follow ups