mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 16:05:06 +00:00
[C++] Updates real_path to be truly portable (#5787)
* Removes posix definition stat and fseeko are not used. Tested on QNX (GCC 5.4.0) and MinGw * Updates realpath to more modern (2008) version * Removes unix specific headers * Adds detection of strtoll_l as android API < 21 does not provide it * Includes cstdlib and formatting Removes cmakelist alterations as not necessary. Formatting not complete. * Stdlib outside if Stdlib is available on all platforms * Fixes indentation * Adds locale check to android build * Adds missing brace * full names * Removes again, no clue * Updates base to check for locale independent android Cmake already checks for others, also MSC? * Changes to test on available and not requested * Fixes android bad xopen_version define * Removes warning
This commit is contained in:
@@ -46,6 +46,10 @@
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
|
||||
#if defined(__unix__) && !defined(FLATBUFFERS_LOCALE_INDEPENDENT)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef _STLPORT_VERSION
|
||||
#define FLATBUFFERS_CPP98_STL
|
||||
#endif
|
||||
@@ -53,6 +57,10 @@
|
||||
#include <functional>
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android/api-level.h>
|
||||
#endif
|
||||
|
||||
#include "flatbuffers/stl_emulation.h"
|
||||
|
||||
#if defined(__ICCARM__)
|
||||
@@ -236,10 +244,8 @@ namespace flatbuffers {
|
||||
|
||||
#ifndef FLATBUFFERS_LOCALE_INDEPENDENT
|
||||
// Enable locale independent functions {strtof_l, strtod_l,strtoll_l, strtoull_l}.
|
||||
// They are part of the POSIX-2008 but not part of the C/C++ standard.
|
||||
// GCC/Clang have definition (_XOPEN_SOURCE>=700) if POSIX-2008.
|
||||
#if ((defined(_MSC_VER) && _MSC_VER >= 1800) || \
|
||||
(defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE>=700)))
|
||||
(defined(_XOPEN_VERSION) && (_XOPEN_VERSION>=700)) && (!defined(__ANDROID_API__) || (defined(__ANDROID_API__) && (__ANDROID_API__>=21))))
|
||||
#define FLATBUFFERS_LOCALE_INDEPENDENT 1
|
||||
#else
|
||||
#define FLATBUFFERS_LOCALE_INDEPENDENT 0
|
||||
|
||||
Reference in New Issue
Block a user