[yaml-cpp] Fix builds with GCC 15 (#45339)

This commit is contained in:
Hyunjin Song 2025-05-08 04:13:13 +09:00 committed by GitHub
parent 253d881094
commit 38d9cf0bd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 46 additions and 2 deletions

View File

@ -6,6 +6,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
"yaml-cpp-pr-1212.patch"
"yaml-cpp-pr-1310.patch"
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" YAML_BUILD_SHARED_LIBS)

View File

@ -1,7 +1,7 @@
{
"name": "yaml-cpp",
"version-semver": "0.8.0",
"port-version": 2,
"port-version": 3,
"description": "yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec.",
"homepage": "https://github.com/jbeder/yaml-cpp",
"documentation": "https://codedocs.xyz/jbeder/yaml-cpp/index.html",

View File

@ -0,0 +1,38 @@
From 0bcee982a6556649ff2af9a7aa0845fa92e893e2 Mon Sep 17 00:00:00 2001
From: Christopher Fore <csfore@posteo.net>
Date: Wed, 14 Aug 2024 21:02:32 -0400
Subject: [PATCH] emitterutils: Explicitly include <cstdint>
GCC 15 will no longer include it by default, resulting in build
failures in projects that do not explicitly include it.
Error:
src/emitterutils.cpp:221:11: error: 'uint16_t' was not declared in this scope
221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
| ^~~~~~~~
src/emitterutils.cpp:13:1: note: 'uint16_t' is defined in header '<cstdint>';
this is probably fixable by adding '#include <cstdint>'
12 | #include "yaml-cpp/null.h"
+++ |+#include <cstdint>
13 | #include "yaml-cpp/ostream_wrapper.h"
Tests pass.
Closes: #1307
See-also: https://gcc.gnu.org/pipermail/gcc-cvs/2024-August/407124.html
See-also: https://bugs.gentoo.org/937412
Signed-off-by: Christopher Fore <csfore@posteo.net>
---
src/emitterutils.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/emitterutils.cpp b/src/emitterutils.cpp
index fc41011a5..f801b1d0c 100644
--- a/src/emitterutils.cpp
+++ b/src/emitterutils.cpp
@@ -1,4 +1,5 @@
#include <algorithm>
+#include <cstdint>
#include <iomanip>
#include <sstream>

View File

@ -10278,7 +10278,7 @@
},
"yaml-cpp": {
"baseline": "0.8.0",
"port-version": 2
"port-version": 3
},
"yara": {
"baseline": "4.5.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "30bb4f655d874206182c1db07bb6cd4f1f9f1c79",
"version-semver": "0.8.0",
"port-version": 3
},
{
"git-tree": "447c1a228690199df9139b51e254e51403d9a963",
"version-semver": "0.8.0",