mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-25 20:14:10 +08:00
Use stricter subset for now to avoid compat issues with Unix-like platforms
This commit is contained in:
parent
d3199a0c39
commit
a13b5cc08d
@ -41,7 +41,7 @@
|
||||
#include <new>
|
||||
|
||||
// For load_file
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
@ -4764,7 +4764,7 @@ PUGI_IMPL_NS_BEGIN
|
||||
// we need to get length of entire file to load it in memory; the only (relatively) sane way to do it is via seek/tell trick
|
||||
PUGI_IMPL_FN xml_parse_status get_file_size(FILE* file, size_t& out_result)
|
||||
{
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
// this simultaneously retrieves the file size and file mode (to guard against loading non-files)
|
||||
struct stat st;
|
||||
if (fstat(fileno(file), &st) != 0) return status_io_error;
|
||||
|
@ -589,7 +589,7 @@ TEST(document_load_file_wide_out_of_memory)
|
||||
CHECK(result.status == status_out_of_memory || result.status == status_file_not_found);
|
||||
}
|
||||
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
TEST(document_load_file_special_folder)
|
||||
{
|
||||
xml_document doc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user