This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 9c0d7122590ec63c4a9cb6e5b019f373e84a6106 (commit) via 1d12df083de4555dbd7aaba94980ca96c71988b8 (commit) from 0243aecd593c5c712078dfa1fbcf8bba1187a736 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/9c0d7122590ec63c4a9cb6e5b019f373e84a6...
commit 9c0d7122590ec63c4a9cb6e5b019f373e84a6106 Author: Cyril Hrubis metan@ucw.cz Date: Mon Jun 4 16:22:41 2012 +0200
pywrap: Fix error reporting.
The python headers define _GNU_SOURCE so the strerror_r variant is GNU one, which uses the passed buffer to create it's data structure and returns pointer to the message.
Also make sure _GNU_SOURCE is defined in pywrap.mk.
diff --git a/pylib/gfxprim/common.i b/pylib/gfxprim/common.i index 66b37b0..bc99ff3 100644 --- a/pylib/gfxprim/common.i +++ b/pylib/gfxprim/common.i @@ -23,11 +23,9 @@ %exception funcname { $action if (result == NULL) { - int errno0 = errno; - const int errbuf_len = 128; - char errbuf[errbuf_len]; - strerror_r(errno0, errbuf, errbuf_len); - PyErr_Format(PyExc_RuntimeError, "Error in function %s: %s", "$name", errbuf); + char errbuf[128]; + char *errmsg = strerror_r(errno, errbuf, sizeof(errbuf)); + PyErr_Format(PyExc_RuntimeError, "Error in function %s: %s", "$name", errmsg); return NULL; } } @@ -42,11 +40,9 @@ %exception funcname { $action if (result != 0) { - int errno0 = errno; - const int errbuf_len = 128; - char errbuf[errbuf_len]; - strerror_r(errno0, errbuf, errbuf_len); - PyErr_Format(PyExc_RuntimeError, "Error in function %s: %s", "$name", errbuf); + char errbuf[128]; + char *errmsg = strerror_r(errno, errbuf, sizeof(errbuf)); + PyErr_Format(PyExc_RuntimeError, "Error in function %s: %s", "$name", errmsg); return NULL; } } diff --git a/pywrap.mk b/pywrap.mk index 0ec5602..03d22cf 100644 --- a/pywrap.mk +++ b/pywrap.mk @@ -23,10 +23,10 @@ endif # VERBOSE
$(SWIG_LIB): $(SWIG_C) ifdef VERBOSE - $(CC) $< $(CFLAGS) $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@ + $(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@ else # VERBOSE @echo "LD $@" - @$(CC) $< $(CFLAGS) $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@ + @$(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@ endif # VERBOSE
endif # ifneq ($(SWIG),)
http://repo.or.cz/w/gfxprim.git/commit/1d12df083de4555dbd7aaba94980ca96c7198...
commit 1d12df083de4555dbd7aaba94980ca96c71988b8 Author: Cyril Hrubis metan@ucw.cz Date: Mon Jun 4 16:05:49 2012 +0200
pywrap: Add make dependency for common.i.
diff --git a/pylib/gfxprim/core/Makefile b/pylib/gfxprim/core/Makefile index 0ee5e15..3be0466 100644 --- a/pylib/gfxprim/core/Makefile +++ b/pylib/gfxprim/core/Makefile @@ -3,6 +3,9 @@ LIBNAME=core
include $(TOPDIR)/pre.mk include $(TOPDIR)/pywrap.mk + +$(SWIG_C): ../common.i + include $(TOPDIR)/post.mk
include ../silence_swig_warnings.mk diff --git a/pylib/gfxprim/loaders/Makefile b/pylib/gfxprim/loaders/Makefile index 791fc74..dd23e98 100644 --- a/pylib/gfxprim/loaders/Makefile +++ b/pylib/gfxprim/loaders/Makefile @@ -4,6 +4,9 @@ INCLUDE=core
include $(TOPDIR)/pre.mk include $(TOPDIR)/pywrap.mk + +$(SWIG_C): ../common.i + include $(TOPDIR)/post.mk
include ../silence_swig_warnings.mk
-----------------------------------------------------------------------
Summary of changes: pylib/gfxprim/common.i | 16 ++++++---------- pylib/gfxprim/core/Makefile | 3 +++ pylib/gfxprim/loaders/Makefile | 3 +++ pywrap.mk | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.