Skip to content

Commit 5f8ecdb

Browse files
committed
Remove local implementation of strtok_r
MS Visual Studio does not provide that function, but can use strtok_s which does exactly the same. Signed-off-by: Stefan Weil <[email protected]>
1 parent 22bcf4d commit 5f8ecdb

File tree

4 files changed

+4
-92
lines changed

4 files changed

+4
-92
lines changed

ccutil/Makefile.am

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,5 @@ libtesseract_ccutil_la_SOURCES = \
4242
params.cpp universalambigs.cpp
4343

4444
if T_WIN
45-
AM_CPPFLAGS += -I$(top_srcdir)/vs2010/port -DWINDLLNAME=\"lib@GENERIC_LIBRARY_NAME@\"
46-
noinst_HEADERS += ../vs2010/port/strtok_r.h
47-
libtesseract_ccutil_la_SOURCES += ../vs2010/port/strtok_r.cpp
45+
AM_CPPFLAGS += -DWINDLLNAME=\"lib@GENERIC_LIBRARY_NAME@\"
4846
endif

ccutil/ambigs.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@
2424
#include "helpers.h"
2525
#include "universalambigs.h"
2626

27-
#if defined _WIN32
28-
#ifndef __GNUC__
29-
#define strtok_r strtok_s
30-
#else
31-
#include "strtok_r.h"
32-
#endif /* __GNUC__ */
33-
#endif /* _WIN32 */
27+
#if defined(_WIN32) && !defined(__GNUC__)
28+
# define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
29+
#endif /* _WIN32 && !__GNUC__ */
3430

3531
namespace tesseract {
3632

vs2010/port/strtok_r.cpp

-55
This file was deleted.

vs2010/port/strtok_r.h

-27
This file was deleted.

0 commit comments

Comments
 (0)