Commit 555e2ea6 authored by Adrian Johnson's avatar Adrian Johnson

Move strtok_r to goo/glibc

Move strtok_r out of poppler-config.h as it is not used in any header files

Move strtok_r.cpp to goo/glibc_strtok_r.cc to keep it with the other emulated
glibc functions. But keep it in a separate file due to the different license.
parent 2ca32d2c
......@@ -369,6 +369,7 @@ set(poppler_SRCS
goo/gstrtod.cc
goo/grandom.cc
goo/glibc.cc
goo/glibc_strtok_r.cc
fofi/FoFiBase.cc
fofi/FoFiEncodings.cc
fofi/FoFiTrueType.cc
......@@ -423,7 +424,6 @@ set(poppler_SRCS
poppler/Stream.cc
poppler/StructTreeRoot.cc
poppler/StructElement.cc
poppler/strtok_r.cpp
poppler/UnicodeMap.cc
poppler/UnicodeTypeTable.cc
poppler/UTF.cc
......
......@@ -32,6 +32,7 @@ check_function_exists(mkstemp HAVE_MKSTEMP)
check_function_exists(rand_r HAVE_RAND_R)
check_function_exists(strcpy_s HAVE_STRCPY_S)
check_function_exists(strcat_s HAVE_STRCAT_S)
check_function_exists(strtok_r HAVE_STRTOK_R)
macro(CHECK_FOR_DIR include var)
check_c_source_compiles(
......
......@@ -94,6 +94,9 @@
/* Define to 1 if you have the `strcat_s' function. */
#cmakedefine HAVE_STRCAT_S 1
/* Defines if strtok_r is available on your system */
#cmakedefine HAVE_STRTOK_R 1
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#cmakedefine HAVE_NDIR_H 1
......
......@@ -31,6 +31,10 @@ struct tm *localtime_r(const time_t *timep, struct tm *result);
time_t timegm(struct tm *tm);
#endif
#ifndef HAVE_STRTOK_R
char * strtok_r (char *s, const char *delim, char **save_ptr);
#endif
}
#endif // GLIBC_H
......
......@@ -55,7 +55,8 @@
//
//========================================================================
#if defined(__MINGW32__) && !defined(__WINPTHREADS_VERSION)
#ifndef HAVE_STRTOK_R
#include <string.h>
#define __rawmemchr strchr
......@@ -89,4 +90,5 @@ char * strtok_r (char *s, const char *delim, char **save_ptr)
}
return token;
}
#endif
......@@ -143,14 +143,6 @@
#define CDECL
#endif
#if defined(_WIN32)
#ifdef _MSC_VER
#define strtok_r strtok_s
#elif __MINGW32__ && !defined(__WINPTHREADS_VERSION)
char * strtok_r (char *s, const char *delim, char **save_ptr);
#endif
#endif
//------------------------------------------------------------------------
// Compiler
//------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment