<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><div><span>It is actually even simpler than that. Only the macro needs to be defined, string_s.h is automatically included after that. So it can be:</span></div><div style="background-color: transparent;"><span><br></span></div><div style="background-color: transparent;">#ifdef __MINGW32__</div><div style="background-color: transparent;">#define MINGW_HAS_SECURE_API 1</div><div style="background-color: transparent;"><span></span></div><div style="background-color: transparent;">#endif</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">The only catch seems to be that these three lines must be at the start of the file, before other includes.</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">Best
 regards</div><div><span></span></div><div style="background-color: transparent;">Nikos</div><div class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Monday, March 3, 2014 11:15 PM, Nikos Barkas <nikbar2004@yahoo.com> wrote:<br> </font> </div>  <div class="y_msg_container"><div id="yiv5334382541"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 12pt;"><div><span>The strtok_s function is the secure api variant of strtok. For MinGW-w64, which is what I am using - on Windows 7, not Linux - using secure api functions requires some work done in advance. The following needs to be
 inserted at the beginning of param.cpp:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal;"><span><br clear="none"></span></div><div style="background-color:transparent;">#ifdef __MINGW32__</div><div style="background-color:transparent;">#define MINGW_HAS_SECURE_API<span class="yiv5334382541Apple-tab-span" style="white-space:pre;">  </span>1</div><div style="background-color:transparent;">#include <sec_api/string_s.h></div><div style="background-color:transparent;"><span></span></div><div style="background-color:transparent;">#endif</div><div style="background-color:transparent;"><br clear="none"></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-style: normal;">The macro MINGW_HAS_SECURE_API must be defined and
 string_s.h must be specifically included. With the above, x265 can be compiled successfully.</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-style: normal;"><br clear="none"></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-style: normal;">Best regards</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-style: normal;">Nikos</div><div class="yiv5334382541yqt4760667226" id="yiv5334382541yqt12890"><div class="yiv5334382541yahoo_quoted" style="display: block;"> <br clear="none"> <br clear="none"> <div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue,
 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Monday, March 3, 2014 8:13 PM, Steve Borho <steve@borho.org> wrote:<br clear="none"> </font> </div>  <div class="yiv5334382541y_msg_container">On Mon, Mar 3, 2014 at 1:29 AM, Nikos Barkas <<a rel="nofollow" shape="rect" ymailto="mailto:nikbar2004@yahoo.com" target="_blank" href="mailto:nikbar2004@yahoo.com">nikbar2004@yahoo.com</a>> wrote:<div class="yiv5334382541yqt2940282891" id="yiv5334382541yqtfd12449"><br clear="none">> Building tip revision 288a83d fails with this message on MinGW x64:<br clear="none">><br clear="none">> c:/x265/source/common/param.cpp: In function 'int x265::parseCpuName(const<br clear="none">> char*, bool&)':<br clear="none">> c:/DriveD/x265Project/x265/source/common/param.cpp:738:59: error: 'strtok_s'<br clear="none">> was not declared in this scope<br
 clear="none">> make[2]: *** [common/CMakeFiles/common.dir/param.cpp.obj] Error 1<br clear="none">> make[1]: *** [common/CMakeFiles/common.dir/all] Error 2<br clear="none">> make: *** [all] Error 2</div><br clear="none"><br clear="none">Odd.  My MinGW wouldn't build with strtok_r, it needed the Windows strtok_s.<br clear="none"><br clear="none">Hmm, so I either need to detect this function at configure time, or<br clear="none">just implement it internally.<br clear="none"><br clear="none">Perhaps this one: <a rel="nofollow" shape="rect" target="_blank" href="http://stackoverflow.com/questions/12975022/strtok-r-for-mingw">http://stackoverflow.com/questions/12975022/strtok-r-for-mingw</a><br clear="none"><br clear="none">Just curious, but is your MinGW hosted on Linux? I'm curious why yours<br clear="none">does not see strtok_s.<br clear="none"><br clear="none">-- <br clear="none">Steve Borho<div class="yiv5334382541yqt2940282891"
 id="yiv5334382541yqtfd53825"><br clear="none"></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div> </div></div></div><br><br></div>  </div> </div>  </div> </div></body></html>