[packages/lodepng] - added c patch so that functions usable from C are not mangled

qboosh qboosh at pld-linux.org
Sat Mar 21 07:32:05 CET 2020


commit 1d88baccc275ef9de01f17ea16b016afb64105bd
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Mar 21 07:33:10 2020 +0100

    - added c patch so that functions usable from C are not mangled

 lodepng-c.patch | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lodepng.spec    |  2 ++
 2 files changed, 65 insertions(+)
---
diff --git a/lodepng.spec b/lodepng.spec
index 2dd700c..998fd37 100644
--- a/lodepng.spec
+++ b/lodepng.spec
@@ -10,6 +10,7 @@ License:	BSD-like + altered sources must be marked
 Group:		Libraries
 Source0:	https://github.com/lvandeve/lodepng/archive/%{gitref}/%{name}-%{snap}.tar.gz
 # Source0-md5:	4557f32be35a404d20f5fcc784fe48c5
+Patch0:		%{name}-c.patch
 URL:		http://lodev.org/lodepng/
 BuildRequires:	libstdc++-devel
 BuildRequires:	libtool >= 2:1.5
@@ -48,6 +49,7 @@ Statyczna biblioteka lodepng.
 
 %prep
 %setup -q -n %{name}-%{gitref}
+%patch0 -p1
 
 %build
 libtool --tag=CXX --mode=compile %{__cxx} %{rpmcxxflags} %{rpmcppflags} -o lodepng.lo -c lodepng.cpp
diff --git a/lodepng-c.patch b/lodepng-c.patch
new file mode 100644
index 0000000..22e9b21
--- /dev/null
+++ b/lodepng-c.patch
@@ -0,0 +1,63 @@
+--- lodepng-e34ac04553e51a6982ae234d98ce6b76dd57a6a1/lodepng.h.orig	2020-03-06 22:34:40.000000000 +0100
++++ lodepng-e34ac04553e51a6982ae234d98ce6b76dd57a6a1/lodepng.h	2020-03-21 07:30:23.031248431 +0100
+@@ -28,8 +28,16 @@
+ 
+ #include <string.h> /*for size_t*/
+ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ extern const char* LODEPNG_VERSION_STRING;
+ 
++#ifdef __cplusplus
++}
++#endif
++
+ /*
+ The following #defines are used to create code sections. They can be disabled
+ to disable code sections, which can give faster compile time and smaller binary.
+@@ -95,6 +103,11 @@
+ #endif /*LODEPNG_COMPILE_CPP*/
+ 
+ #ifdef LODEPNG_COMPILE_PNG
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ /*The PNG color types (also used for raw image).*/
+ typedef enum LodePNGColorType {
+   LCT_GREY = 0, /*grayscale: 1,2,4,8,16 bit*/
+@@ -207,6 +220,9 @@
+ #endif /*LODEPNG_COMPILE_DISK*/
+ #endif /*LODEPNG_COMPILE_ENCODER*/
+ 
++#ifdef __cplusplus
++}
++#endif
+ 
+ #ifdef LODEPNG_COMPILE_CPP
+ namespace lodepng {
+@@ -257,6 +273,10 @@
+ #endif /*LODEPNG_COMPILE_CPP*/
+ #endif /*LODEPNG_COMPILE_PNG*/
+ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ #ifdef LODEPNG_COMPILE_ERROR_TEXT
+ /*Returns an English description of the numerical error code.*/
+ const char* lodepng_error_text(unsigned code);
+@@ -964,6 +984,10 @@
+ unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename);
+ #endif /*LODEPNG_COMPILE_DISK*/
+ 
++#ifdef __cplusplus
++}
++#endif
++
+ #ifdef LODEPNG_COMPILE_CPP
+ /* The LodePNG C++ wrapper uses std::vectors instead of manually allocated memory buffers. */
+ namespace lodepng {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lodepng.git/commitdiff/1d88baccc275ef9de01f17ea16b016afb64105bd



More information about the pld-cvs-commit mailing list