Hello community,
here is the log from the commit of package exempi
checked in at Thu Aug 21 22:58:00 CEST 2008.
--------
--- GNOME/exempi/exempi.changes 2008-08-06 23:24:53.000000000 +0200
+++ exempi/exempi.changes 2008-08-20 16:37:41.000000000 +0200
@@ -1,0 +2,8 @@
+Tue Aug 12 23:37:28 EDT 2008 - hfiguiere@suse.de
+
+- New upstream version 2.0.2
+ + Fix bug fdo#16598: TLS detection.
+ + Better error management
+ + Bugs fdo#14612 and fdo#14613
+
+-------------------------------------------------------------------
Old:
----
exempi-2.0.1.tar.bz2
New:
----
exempi-2.0.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ exempi.spec ++++++
--- /var/tmp/diff_new_pack.D27851/_old 2008-08-21 22:55:21.000000000 +0200
+++ /var/tmp/diff_new_pack.D27851/_new 2008-08-21 22:55:21.000000000 +0200
@@ -1,7 +1,6 @@
#
-# spec file for package exempi (Version 2.0.1)
+# spec file for package exempi (Version 2.0.2)
#
-# Copyright (c) 2007 Novell Inc.
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
@@ -18,17 +17,13 @@
# norootforbuild
+BuildRequires: boost-devel >= 1.33.0
+BuildRequires: gcc-c++
+BuildRequires: libexpat-devel
Name: exempi
Url: http://libopenraw.freedesktop.org/wiki/Exempi
- #
-# spec file for package exempi
-#
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
-#
-BuildRequires: boost-devel >= 1.33.0 gcc-c++ libexpat-devel
-Version: 2.0.1
+Version: 2.0.2
Release: 1
Summary: XMP support library
License: BSD 3-Clause
@@ -117,6 +112,11 @@
%{_libdir}/pkgconfig/*.pc
%changelog
+* Wed Aug 13 2008 hfiguiere@suse.de
+- New upstream version 2.0.2
+ + Fix bug fdo#16598: TLS detection.
+ + Better error management
+ + Bugs fdo#14612 and fdo#14613
* Wed Aug 06 2008 mauro@suse.de
-Update to 2.0.1
+ bgo#14612: no stdbool.h for Sun compilers.
++++++ exempi-2.0.1.tar.bz2 -> exempi-2.0.2.tar.bz2 ++++++
++++ 5074 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/exempi-2.0.1/ChangeLog new/exempi-2.0.2/ChangeLog
--- old/exempi-2.0.1/ChangeLog 2008-04-29 02:53:51.000000000 +0200
+++ new/exempi-2.0.2/ChangeLog 2008-08-13 05:02:11.000000000 +0200
@@ -1,3 +1,15 @@
+2008-08-12 Hubert Figuiere
+
+ * exempi/exempi.cpp (set_error): Use pthread for the TLS
+ if there is no compiler support.
+ (Closes #16598)
+
+ * configure.ac:
+ * m4/ax_tls.m4:
+ Check for TLS.
+
+=== 2.0.1 ===
+
2008-04-28 Hubert Figuiere
* exempi/tests/test1.cpp: Check that errors are unset.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/exempi-2.0.1/configure.ac new/exempi-2.0.2/configure.ac
--- old/exempi-2.0.1/configure.ac 2008-04-06 07:02:58.000000000 +0200
+++ new/exempi-2.0.2/configure.ac 2008-08-13 05:02:11.000000000 +0200
@@ -9,7 +9,7 @@
AC_PREREQ(2.50)
AC_INIT(exempi/xmp.h)
-AM_INIT_AUTOMAKE(exempi, 2.0.1)
+AM_INIT_AUTOMAKE(exempi, 2.0.2)
AM_MAINTAINER_MODE
dnl ---------------------------------------------------------------------------
@@ -47,7 +47,8 @@
dnl 1.99.9 is the revision 4.1.1 (no library change have been made)
dnl 2.0.0 is the revision 4.1.2
dnl 2.0.1 is the revision 4.1.3
-AC_SUBST([EXEMPI_REVISION], [3])
+dnl 2.0.2 is the revision 4.1.4
+AC_SUBST([EXEMPI_REVISION], [4])
AC_SUBST([EXEMPI_AGE], [1])
AC_SUBST([EXEMPI_CURRENT], [4])
AC_SUBST([EXEMPI_CURRENT_MIN],
@@ -124,6 +125,14 @@
[Define as const if the declaration of iconv() needs const.])
dnl end iconv checks
+
+dnl TLS.
+AX_TLS
+if test "$ac_cv_tls" != "none"; then
+ AC_DEFINE(HAVE_NATIVE_TLS, [1], [Define if compiler has native TLS.])
+fi
+dnl end TLS
+
AC_ARG_ENABLE(unittest,
AC_HELP_STRING([--enable-unittest=yes|no],
[enable the unittest. requires boost (default is yes)]),
@@ -197,8 +206,9 @@
echo "
Defines:
- EXEMPI_PLATFORM_DEF = $EXEMPI_PLATFORM_DEF
- CPPFLAGS = $CPPFLAGS
- LDFLAGS = $LDFLAGS
- Run unit test = $ENABLE_UNITTEST
+ EXEMPI_PLATFORM_DEF = $EXEMPI_PLATFORM_DEF
+ CPPFLAGS = $CPPFLAGS
+ LDFLAGS = $LDFLAGS
+ Thread Local Storage = $ac_cv_tls
+ Run unit test = $ENABLE_UNITTEST
"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/exempi-2.0.1/exempi/exempi.cpp new/exempi-2.0.2/exempi/exempi.cpp
--- old/exempi-2.0.1/exempi/exempi.cpp 2008-04-24 06:52:28.000000000 +0200
+++ new/exempi-2.0.2/exempi/exempi.cpp 2008-08-13 05:02:11.000000000 +0200
@@ -1,7 +1,7 @@
/*
* exempi - exempi.cpp
*
- * Copyright (C) 2007 Hubert Figuiere
+ * Copyright (C) 2007-2008 Hubert Figuiere
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,7 @@
#include "xmp.h"
#include "xmperrors.h"
+
#include <string>
#include <iostream>
@@ -50,14 +51,76 @@
#include "XMP.hpp"
#include "XMP.incl_cpp"
-/* TODO make the thread local storage portable */
-static __thread int g_error = 0;
+
+#if HAVE_NATIVE_TLS
+
+static TLS int g_error = 0;
static void set_error(int err)
{
- g_error = err;
+ g_error = err;
+}
+
+#else
+
+#include
+
+/* Portable thread local storage using pthreads */
+static pthread_key_t key = NULL;
+static pthread_once_t key_once = PTHREAD_ONCE_INIT;
+
+/* Destructor called when a thread exits - ensure to delete allocated int pointer */
+static void destroy_tls_key( void * ptr )
+{
+ int* err_ptr = static_cast(ptr);
+ delete err_ptr;
}
+/* Create a key for use with pthreads local storage */
+static void create_tls_key()
+{
+ (void) pthread_key_create(&key, destroy_tls_key);
+}
+
+/* Obtain the latest xmp error for this specific thread - defaults to 0 */
+static int get_error_for_thread()
+{
+ int * err_ptr;
+
+ pthread_once(&key_once, create_tls_key);
+ err_ptr = (int *) pthread_getspecific(key);
+
+ if(err_ptr == NULL) {
+ return 0;
+ }
+
+ return *err_ptr;
+}
+
+/* set the current xmp error for this specific thread */
+static void set_error(int err)
+{
+ int * err_ptr;
+
+ // Ensure that create_thread_local_storage_key is only called
+ // once, by the first thread, to create the key.
+ pthread_once(&key_once, create_tls_key);
+
+ // Retrieve pointer to int for this thread.
+ err_ptr = (int *) pthread_getspecific(key);
+
+ // Allocate it, if it does not exists.
+ if( err_ptr == NULL ) {
+ err_ptr = new int;
+ pthread_setspecific(key, err_ptr);
+ }
+
+ // Save the error for this thread.
+ *err_ptr = err;
+}
+
+#endif
+
static void set_error(const XMP_Error & e)
{
set_error(-e.GetID());
@@ -111,7 +174,11 @@
int xmp_get_error()
{
- return g_error;
+#if HAVE_NATIVE_TLS
+ return g_error;
+#else
+ return get_error_for_thread();
+#endif
}
bool xmp_init()
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/exempi-2.0.1/m4/ax_tls.m4 new/exempi-2.0.2/m4/ax_tls.m4
--- old/exempi-2.0.1/m4/ax_tls.m4 1970-01-01 01:00:00.000000000 +0100
+++ new/exempi-2.0.2/m4/ax_tls.m4 2008-08-13 03:26:40.000000000 +0200
@@ -0,0 +1,78 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_tls.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TLS
+#
+# DESCRIPTION
+#
+# Provides a test for the compiler support of thread local storage (TLS)
+# extensions. Defines TLS if it is found. Currently only knows about GCC
+# and MSVC. I think SunPro uses the same as GCC, and Borland apparently
+# supports either.
+#
+# LAST MODIFICATION
+#
+# 2008-04-12
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Alan Woodland
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see http://www.gnu.org/licenses/.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Macro Archive. When you make and
+# distribute a modified version of the Autoconf Macro, you may extend this
+# special exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_TLS], [
+ AC_MSG_CHECKING(for thread local storage (TLS) class)
+ AC_CACHE_VAL(ac_cv_tls, [
+ ax_tls_keywords="__thread __declspec(thread) none"
+ for ax_tls_keyword in $ax_tls_keywords; do
+ case $ax_tls_keyword in
+ none) ac_cv_tls=none ; break ;;
+ *)
+ AC_TRY_COMPILE(
+ [#include
+ static void
+ foo(void) {
+ static ] $ax_tls_keyword [ int bar;
+ exit(1);
+ }],
+ [],
+ [ac_cv_tls=$ax_tls_keyword ; break],
+ ac_cv_tls=none
+ )
+ esac
+ done
+])
+
+ if test "$ac_cv_tls" != "none"; then
+ dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
+ AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+ fi
+ AC_MSG_RESULT($ac_cv_tls)
+])
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/exempi-2.0.1/NEWS new/exempi-2.0.2/NEWS
--- old/exempi-2.0.1/NEWS 2008-04-24 06:53:08.000000000 +0200
+++ new/exempi-2.0.2/NEWS 2008-08-13 05:02:11.000000000 +0200
@@ -1,3 +1,7 @@
+2.0.2
+
+- Bug #16598: address the lack of TLS for sone platforms.
+
2.0.1
- Bug #14612: no stdbool.h for Sun compilers.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org