Hello community,
here is the log from the commit of package libexiv2
checked in at Fri Oct 5 15:58:25 CEST 2007.
--------
--- libexiv2/libexiv2.changes 2007-08-31 11:38:37.000000000 +0200
+++ /mounts/work_src_done/STABLE/libexiv2/libexiv2.changes 2007-10-05 01:48:10.000000000 +0200
@@ -1,0 +2,5 @@
+Fri Oct 5 01:47:59 CEST 2007 - dmueller@suse.de
+
+- fix build with gcc 4.3 (upstream backport)
+
+-------------------------------------------------------------------
New:
----
gcc43.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libexiv2.spec ++++++
--- /var/tmp/diff_new_pack.G28995/_old 2007-10-05 15:58:15.000000000 +0200
+++ /var/tmp/diff_new_pack.G28995/_new 2007-10-05 15:58:15.000000000 +0200
@@ -12,15 +12,16 @@
Name: libexiv2
BuildRequires: doxygen gcc-c++ gettext-devel libxslt python zlib-devel
-URL: http://www.exiv2.org/
+Url: http://www.exiv2.org/
License: GPL v2 or later
Group: Development/Libraries/C and C++
Summary: Library and tools to access image metadata
Version: 0.15
-Release: 1
+Release: 9
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: exiv2-%version.tar.bz2
Patch0: remove-URL-pkgconfig.diff
+Patch1: gcc43.diff
%description
Exiv2 is a C++ library and a command line utility to access image
@@ -53,6 +54,7 @@
%if %suse_version < 1000
%patch
%endif
+%patch1
%build
export CXXFLAGS="$RPM_OPT_FLAGS"
@@ -67,6 +69,10 @@
%clean
rm -rf $RPM_BUILD_ROOT
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
%files -f exiv2.lang
%defattr(-,root,root)
%doc doc/ChangeLog doc/cmd.txt
@@ -82,8 +88,9 @@
%{_libdir}/libexiv2.so
%{_libdir}/pkgconfig/exiv2.pc
%{_mandir}/man*/*
-
%changelog
+* Fri Oct 05 2007 - dmueller@suse.de
+- fix build with gcc 4.3 (upstream backport)
* Fri Aug 31 2007 - dmueller@suse.de
- update to 0.15:
* Image with large invalid Exif tag crashes exiv2.
++++++ gcc43.diff ++++++
--- src/types.cpp
+++ src/types.cpp
@@ -44,6 +44,7 @@ EXIV2_RCSID("@(#) $Id$")
#include <ctime>
#include <cstdio>
#include <cassert>
+#include <cstring>
// *****************************************************************************
// class member definitions
@@ -111,7 +112,7 @@ namespace Exiv2 {
{
if (size > 0) {
pData_ = new byte[size];
- memcpy(pData_, pData, size);
+ std::memcpy(pData_, pData, size);
size_ = size;
}
}
@@ -326,8 +327,8 @@ namespace Exiv2 {
assert(tm != 0);
int rc = 1;
int year, mon, mday, hour, min, sec;
- int scanned = sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d",
- &year, &mon, &mday, &hour, &min, &sec);
+ int scanned = std::sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d",
+ &year, &mon, &mday, &hour, &min, &sec);
if (scanned == 6) {
tm->tm_year = year - 1900;
tm->tm_mon = mon - 1;
--- src/basicio.cpp
+++ src/basicio.cpp
@@ -44,6 +44,7 @@ EXIV2_RCSID("@(#) $Id$")
// + standard includes
#include <string>
#include <memory>
+#include <cstring>
#include <cassert>
#include <cstdio> // for remove, rename
#include <cstdlib> // for alloc, realloc, free
@@ -172,22 +173,22 @@ namespace Exiv2 {
if (oldOpMode == opSeek) return 0;
// Flush. On msvcrt fflush does not do the job
- fseek(fp_, 0, SEEK_CUR);
+ std::fseek(fp_, 0, SEEK_CUR);
return 0;
}
// Reopen the file
- long offset = ftell(fp_);
+ long offset = std::ftell(fp_);
if (offset == -1) return -1;
if (open("r+b") != 0) return 1;
- return fseek(fp_, offset, SEEK_SET);
+ return std::fseek(fp_, offset, SEEK_SET);
}
long FileIo::write(const byte* data, long wcount)
{
assert(fp_ != 0);
if (switchMode(opWrite) != 0) return 0;
- return (long)fwrite(data, 1, wcount, fp_);
+ return (long)std::fwrite(data, 1, wcount, fp_);
}
long FileIo::write(BasicIo& src)
@@ -202,7 +203,7 @@ namespace Exiv2 {
long writeCount = 0;
long writeTotal = 0;
while ((readCount = src.read(buf, sizeof(buf)))) {
- writeTotal += writeCount = (long)fwrite(buf, 1, readCount, fp_);
+ writeTotal += writeCount = (long)std::fwrite(buf, 1, readCount, fp_);
if (writeCount != readCount) {
// try to reset back to where write stopped
src.seek(writeCount-readCount, BasicIo::cur);
@@ -230,7 +231,7 @@ namespace Exiv2 {
}
close();
struct stat buf;
- if (stat(path_.c_str(), &buf) == -1) {
+ if (::stat(path_.c_str(), &buf) == -1) {
throw Error(2, path_, strError(), "stat");
}
// MSVCRT rename that does not overwrite existing files
@@ -242,7 +243,7 @@ namespace Exiv2 {
}
std::remove(fileIo->path_.c_str());
// Set original file permissions
- if (chmod(path_.c_str(), buf.st_mode) == -1) {
+ if (::chmod(path_.c_str(), buf.st_mode) == -1) {
throw Error(2, fileIo->path_, strError(), "chmod");
}
}
@@ -287,13 +288,13 @@ namespace Exiv2 {
}
if (switchMode(opSeek) != 0) return 1;
- return fseek(fp_, offset, fileSeek);
+ return std::fseek(fp_, offset, fileSeek);
}
long FileIo::tell() const
{
assert(fp_ != 0);
- return ftell(fp_);
+ return std::ftell(fp_);
}
@@ -301,7 +302,7 @@ namespace Exiv2 {
{
// Flush and commit only if the file is open for writing
if (fp_ != 0 && (openMode_[0] != 'r' || openMode_[1] == '+')) {
- fflush(fp_);
+ std::fflush(fp_);
#if defined WIN32 && !defined __CYGWIN__
// This is required on msvcrt before stat after writing to a file
_commit(_fileno(fp_));
@@ -309,7 +310,7 @@ namespace Exiv2 {
}
struct stat buf;
- int ret = stat(path_.c_str(), &buf);
+ int ret = ::stat(path_.c_str(), &buf);
if (ret != 0) return -1;
return buf.st_size;
@@ -324,12 +325,12 @@ namespace Exiv2 {
int FileIo::open(const std::string& mode)
{
if (fp_ != 0) {
- fclose(fp_);
+ std::fclose(fp_);
}
openMode_ = mode;
opMode_ = opSeek;
- fp_ = fopen(path_.c_str(), mode.c_str());
+ fp_ = std::fopen(path_.c_str(), mode.c_str());
if (!fp_) return 1;
return 0;
}
@@ -342,7 +343,7 @@ namespace Exiv2 {
int FileIo::close()
{
if (fp_ != 0) {
- fclose(fp_);
+ std::fclose(fp_);
fp_= 0;
}
return 0;
@@ -361,7 +362,7 @@ namespace Exiv2 {
{
assert(fp_ != 0);
if (switchMode(opRead) != 0) return 0;
- return (long)fread(buf, 1, rcount, fp_);
+ return (long)std::fread(buf, 1, rcount, fp_);
}
int FileIo::getb()
@@ -379,7 +380,7 @@ namespace Exiv2 {
bool FileIo::eof() const
{
assert(fp_ != 0);
- return feof(fp_) != 0;
+ return feof(fp_) != 0;
}
std::string FileIo::path() const
@@ -449,7 +450,7 @@ namespace Exiv2 {
{
reserve(wcount);
assert(isMalloced_);
- memcpy(&data_[idx_], data, wcount);
+ std::memcpy(&data_[idx_], data, wcount);
idx_ += wcount;
return wcount;
}
@@ -562,7 +563,7 @@ namespace Exiv2 {
{
long avail = size_ - idx_;
long allow = std::min(rcount, avail);
- memcpy(buf, &data_[idx_], allow);
+ std::memcpy(buf, &data_[idx_], allow);
idx_ += allow;
if (rcount > avail) eof_ = true;
return allow;
--- src/iotest.cpp
+++ src/iotest.cpp
@@ -33,6 +33,7 @@
#include "error.hpp"
#include "futils.hpp"
#include "basicio.hpp"
+#include <cstring>
#include <iostream>
using Exiv2::byte;
@@ -135,8 +136,8 @@ int WriteReadSeek(BasicIo &io)
const char tester2[] = "Appending this on the end";
const char expect[] = "this is a little teAppending this on the end";
const long insert = 19;
- const long len1 = (long)strlen(tester1) + 1;
- const long len2 = (long)strlen(tester2) + 1;
+ const long len1 = (long)std::strlen(tester1) + 1;
+ const long len2 = (long)std::strlen(tester2) + 1;
if (io.open() != 0) {
throw Error(9, io.path(), strError());
@@ -155,7 +156,7 @@ int WriteReadSeek(BasicIo &io)
io.seek(-len1, BasicIo::cur);
int c = EOF;
- memset(buf, -1, sizeof(buf));
+ std::memset(buf, -1, sizeof(buf));
for (int i = 0; (c=io.getb()) != EOF; ++i) {
buf[i] = (byte)c;
}
@@ -204,7 +205,7 @@ int WriteReadSeek(BasicIo &io)
if (io.open() != 0) {
throw Error(9, io.path(), strError());
}
- memset(buf, -1, sizeof(buf));
+ std::memset(buf, -1, sizeof(buf));
if (io.read(buf, sizeof(buf)) != insert + len2) {
std::cerr << ": WRS something went wrong\n";
return 10;
@@ -216,11 +217,10 @@ int WriteReadSeek(BasicIo &io)
return 11;
}
- if (strcmp(expect, (char*)buf) != 0 ) {
+ if (std::strcmp(expect, (char*)buf) != 0 ) {
std::cerr << ": WRS strings don't match 2\n";
return 12;
}
return 0;
}
-
--- src/value.hpp
+++ src/value.hpp
@@ -42,6 +42,7 @@
#include <iostream>
#include <sstream>
#include <memory>
+#include <cstring>
// *****************************************************************************
// namespace extensions
@@ -1414,7 +1416,7 @@ namespace Exiv2 {
{
if (rhs.sizeDataArea_ > 0) {
pDataArea_ = new byte[rhs.sizeDataArea_];
- memcpy(pDataArea_, rhs.pDataArea_, rhs.sizeDataArea_);
+ std::memcpy(pDataArea_, rhs.pDataArea_, rhs.sizeDataArea_);
sizeDataArea_ = rhs.sizeDataArea_;
}
}
@@ -1435,7 +1437,7 @@ namespace Exiv2 {
byte* tmp = 0;
if (rhs.sizeDataArea_ > 0) {
tmp = new byte[rhs.sizeDataArea_];
- memcpy(tmp, rhs.pDataArea_, rhs.sizeDataArea_);
+ std::memcpy(tmp, rhs.pDataArea_, rhs.sizeDataArea_);
}
delete[] pDataArea_;
pDataArea_ = tmp;
@@ -1586,7 +1588,7 @@ namespace Exiv2 {
byte* tmp = 0;
if (len > 0) {
tmp = new byte[len];
- memcpy(tmp, buf, len);
+ std::memcpy(tmp, buf, len);
}
delete[] pDataArea_;
pDataArea_ = tmp;
--- src/utils.cpp
+++ src/utils.cpp
@@ -49,6 +49,7 @@ EXIV2_RCSID("@(#) $Id$")
# include