@@ -246,7 +246,25 @@ check_cxx_source_compiles( | |||||
"#include <list> | "#include <list> | ||||
int main(){std::list<int> l; __typeof__(l.begin()) p=l.begin();}" | int main(){std::list<int> l; __typeof__(l.begin()) p=l.begin();}" | ||||
CPPCMS_HAVE_UNDERSCORE_TYPEOF) | CPPCMS_HAVE_UNDERSCORE_TYPEOF) | ||||
check_cxx_source_compiles( | |||||
"#ifndef _FILE_OFFSET_BITS | |||||
#define _FILE_OFFSET_BITS 64 | |||||
#endif | |||||
#include <stdio.h> | |||||
int main() | |||||
{ | |||||
char is_big[sizeof(off_t) >= 8 ? 1 : -1]; | |||||
fseeko(0,0,0); | |||||
}" | |||||
CPPCMS_HAVE_FSEEKO | |||||
) | |||||
check_cxx_source_compiles( | |||||
"#include <stdio.h> | |||||
int main() | |||||
{ _fseeki64(0,0,0); }" | |||||
CPPCMS_HAVE_FSEEKI64 | |||||
) | |||||
if(NOT DISABLE_GZIP) | if(NOT DISABLE_GZIP) | ||||
find_library(ZLIB NAMES z zdll zlib${ZLIB_SUFFIX} zlib) | find_library(ZLIB NAMES z zdll zlib${ZLIB_SUFFIX} zlib) | ||||
find_path(ZLIB_INCLUDE_DIR zlib.h) | find_path(ZLIB_INCLUDE_DIR zlib.h) | ||||
@@ -110,6 +110,8 @@ | |||||
#cmakedefine CPPCMS_NO_GZIP | #cmakedefine CPPCMS_NO_GZIP | ||||
#cmakedefine CPPCMS_SQLITE_LINK_STATIC | #cmakedefine CPPCMS_SQLITE_LINK_STATIC | ||||
#cmakedefine CPPCMS_HAS_THREAD_PSHARED | #cmakedefine CPPCMS_HAS_THREAD_PSHARED | ||||
#cmakedefine CPPCMS_HAVE_FSEEKI64 | |||||
#cmakedefine CPPCMS_HAVE_FSEEKO | |||||
#endif | #endif |
@@ -10,10 +10,14 @@ | |||||
#ifndef _FILE_OFFSET_BITS | #ifndef _FILE_OFFSET_BITS | ||||
#define _FILE_OFFSET_BITS 64 | #define _FILE_OFFSET_BITS 64 | ||||
#endif | #endif | ||||
#ifdef CPPCMS_WIN_NATIVE | |||||
#include <cppcms/config.h> | |||||
#include <stdlib.h> | |||||
#ifdef CPPCMS_HAVE_FSEEKO | |||||
// nothing | |||||
#elif defined(CPPCMS_HAVE_FSEEKI64) | |||||
#define fseeko(f,o,w) _fseeki64(f,o,w) | #define fseeko(f,o,w) _fseeki64(f,o,w) | ||||
#define ftello(f) _ftelli64(f) | |||||
#else | |||||
#define fseek(f,o,w) fseek(f,o,w) | |||||
#endif | #endif | ||||
#include <booster/nowide/cstdio.h> | #include <booster/nowide/cstdio.h> | ||||
@@ -131,8 +131,6 @@ int main() | |||||
test(size,inmem[m]); | test(size,inmem[m]); | ||||
} | } | ||||
} | } | ||||
FILE *f=0; | |||||
TEST(sizeof( ftello(f) ) > 4); | |||||
} | } | ||||
catch(std::exception const &e) { | catch(std::exception const &e) { | ||||
std::cerr << "FAIL: " << e.what() << std::endl; | std::cerr << "FAIL: " << e.what() << std::endl; | ||||