← Back to team overview

kicad-developers team mailing list archive

[PATCH] Add missing include in kicad_string.h


Without this include the HAVE_STRTOKR define won't be available to
the preprocessor and the strtok_r function will be declared
unconditionally and eventually clash with the declaration from the
system provided equivalent:

../../include/kicad_string.h:171:71: error: declaration of 'char* strtok_r(char*, const char*, char**)' has a different exception specifier
 extern "C" char* strtok_r( char* str, const char* delim, char** nextp );
In file included from /usr/x86_64-pc-linux-gnu/include/wx-3.0/wx/string.h:38:0,
                 from ../../include/kicad_string.h:33,
                 from ../../pcbnew/netlist_reader.cpp:31:
/usr/x86_64-pc-linux-gnu/include/string.h:354:14: error: from previous declaration 'char* strtok_r(char*, const char*, char**) throw ()'
 include/kicad_string.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/kicad_string.h b/include/kicad_string.h
index e65486c..d3136a3 100644
--- a/include/kicad_string.h
+++ b/include/kicad_string.h
@@ -30,6 +30,8 @@
 #ifndef KICAD_STRING_H_
 #define KICAD_STRING_H_
+#include "config.h"
 #include <wx/string.h>
 #include <wx/filename.h>

Follow ups