Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream into dev #4

Merged
merged 42 commits into from
Feb 4, 2023
Merged

Merge upstream into dev #4

merged 42 commits into from
Feb 4, 2023

Conversation

halx99
Copy link
Owner

@halx99 halx99 commented Feb 3, 2023

No description provided.

zeux and others added 30 commits February 8, 2022 22:44
This is the same fix as #497, but we're using auto_deleter instead
because if allocation function throws, we can't rely on an explicit call
to deallocate.

Comes along with two tests that validate the behavior.
Fix memory leak during OOM in convert_buffer
sprintf now results in a deprecation warning in Xcode 14 beta.
... I forgot we still support platforms without C99, 23 years later.
Enable usage of nullptr for MSVC 16 and newer (MSVS 2010)
This fixes compilation of pugixml with -fvisibility=hidden. Without
this patch, one would get lots of unresolved symbols when consuming
pugixml as a shared library.
Correctly set default visibility on non-windows compilers
* xml_node::set_value(const char_t* rhs, size_t sz)
* xml_text::set(const char_t* rhs, size_t sz)

Signed-off-by: Ferenc Géczi <[email protected]>
This cleans up xml_attribute::set_value to be uniform wrt
xml_node::set_value and xml_text::set_value - for now we duplicate the
body since the logic is trivial and this keeps debug performance
excellent.
There were two conditions under which xml_document::save_file could
previously return true even though the saving failed:

- The last write to the file was buffered in stdio buffer, and it's that
  last write that would fail due to lack of disk space
- The data has been written correctly but fclose failed to update file
  metadata, which can result in truncated size / missing inode updates.

This change fixes both by adjusting save_file to fflush before the check,
and also checking fclose results. Note that while fflush here is
technically redundant, because it's implied by fclose, we must check
ferror explicitly anyway, and so it feels a little cleaner to do most of
the error handling in save_file_impl, so that the changes of fclose()
failing are very slim.

Of course, neither change guarantees that the contents of the file are
going to be safe on disk following a power failure.
Fix error handling in xml_document::save_file
This also turns the define for PUGIXML_API into an `$<IF:>`, instead of an
`$<IF:>` with an empty true condition. If this is inadequate, I will
undo it, and place them on separate lines as they were before, but will
most likely use an inverse `$<NOT:>` instead of an `$<IF:>`.
Fix exported symbols under clang-cl (Closes #503)
This includes a previously unnoticed link fix for xml_text::set
zeux and others added 12 commits October 20, 2022 20:20
Prepare for 1.13 release
We use snprintf when stdc is set to C++11, however in C++98 mode we can't use variadic macros,
and Xcode 14 complains about the use of sprintf.

It should be safe however to use variadic macros on any remotely recent version of clang on Apple,
unless -pedantic is defined which warns against the use of variadic macros in C++98 mode...

This change fixes the problem for the builds that don't specify -pedantic, which is a problem for
another day.
Fix Xcode 14 sprintf deprecation warning
The feature was added in 2015 but somehow was never documented.
Signed-off-by: David Korczynski <[email protected]>
@halx99 halx99 merged commit aee049f into halx99:dev Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants