[packages/spdlog] - fix var clash with a constant from limits.h - rel 2

baggins baggins at pld-linux.org
Tue Jun 9 22:35:18 CEST 2020


commit 1c7a06fd2360d096aa2bb55959270e20e8bcd003
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Jun 9 22:34:41 2020 +0200

    - fix var clash with a constant from limits.h
    - rel 2

 spdlog.spec          |  4 +++-
 var-name-clash.patch | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)
---
diff --git a/spdlog.spec b/spdlog.spec
index c9e2710..715f7dc 100644
--- a/spdlog.spec
+++ b/spdlog.spec
@@ -2,13 +2,14 @@ Summary:	Very fast C++ logging library
 Summary(pl.UTF-8):	Bardzo szybka biblioteka C++ do logowania
 Name:		spdlog
 Version:	1.12
-Release:	1
+Release:	2
 License:	MIT
 Group:		Development/Libraries
 #Source0Download: https://github.com/COMBINE-lab/spdlog/releases
 Source0:	https://github.com/COMBINE-lab/spdlog/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	e05894aef7494567b417328cee683a55
 Patch0:		libdir.patch
+Patch1:		var-name-clash.patch
 URL:		https://github.com/COMBINE-lab/spdlog
 BuildRequires:	cmake >= 3.1
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -36,6 +37,7 @@ logowania.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 install -d build
diff --git a/var-name-clash.patch b/var-name-clash.patch
new file mode 100644
index 0000000..edc6b32
--- /dev/null
+++ b/var-name-clash.patch
@@ -0,0 +1,40 @@
+--- spdlog-1.12/include/spdlog/fmt/bundled/format.h~	2016-08-26 14:39:00.000000000 +0200
++++ spdlog-1.12/include/spdlog/fmt/bundled/format.h	2020-06-09 22:31:27.877890734 +0200
+@@ -2195,29 +2195,29 @@
+         typedef typename BasicWriter<Char>::CharPtr CharPtr;
+         Char fill = internal::CharTraits<Char>::cast(spec_.fill());
+         CharPtr out = CharPtr();
+-        const unsigned CHAR_WIDTH = 1;
+-        if (spec_.width_ > CHAR_WIDTH)
++        const unsigned _SPD_CHAR_WIDTH = 1;
++        if (spec_.width_ > _SPD_CHAR_WIDTH)
+         {
+             out = writer_.grow_buffer(spec_.width_);
+             if (spec_.align_ == ALIGN_RIGHT)
+             {
+-                std::uninitialized_fill_n(out, spec_.width_ - CHAR_WIDTH, fill);
+-                out += spec_.width_ - CHAR_WIDTH;
++                std::uninitialized_fill_n(out, spec_.width_ - _SPD_CHAR_WIDTH, fill);
++                out += spec_.width_ - _SPD_CHAR_WIDTH;
+             }
+             else if (spec_.align_ == ALIGN_CENTER)
+             {
+                 out = writer_.fill_padding(out, spec_.width_,
+-                                           internal::const_check(CHAR_WIDTH), fill);
++                                           internal::const_check(_SPD_CHAR_WIDTH), fill);
+             }
+             else
+             {
+-                std::uninitialized_fill_n(out + CHAR_WIDTH,
+-                                          spec_.width_ - CHAR_WIDTH, fill);
++                std::uninitialized_fill_n(out + _SPD_CHAR_WIDTH,
++                                          spec_.width_ - _SPD_CHAR_WIDTH, fill);
+             }
+         }
+         else
+         {
+-            out = writer_.grow_buffer(CHAR_WIDTH);
++            out = writer_.grow_buffer(_SPD_CHAR_WIDTH);
+         }
+         *out = internal::CharTraits<Char>::cast(value);
+     }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/spdlog.git/commitdiff/1c7a06fd2360d096aa2bb55959270e20e8bcd003



More information about the pld-cvs-commit mailing list