Package: nvidia-texture-tools
Version: 2.0.8-1+dfsg-2
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch quantal

When built against libtiff5 (as will be the default for libtiff-dev in
Ubuntu 12.10, and I believe in Debian jessie), nvidia-texture-tools
fails to build on amd64 as follows:

  [ 36%] Building CXX object src/nvimage/CMakeFiles/nvimage.dir/ImageIO.cpp.o
  In file included from /usr/include/tiffio.h:33:0,
                   from 
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:31:
  /usr/include/tiff.h:77:23: error: conflicting declaration 'typedef long int 
int64'
  In file included from 
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvcore/nvcore.h:163:0,
                   from 
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvcore/Ptr.h:6,
                   from 
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:3:
  
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvcore/DefsGnucLinux.h:62:29:
 error: 'int64' has a previous declaration as 'typedef long long int int64'
  In file included from /usr/include/tiffio.h:33:0,
                   from 
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:31:
  /usr/include/tiff.h:78:23: error: conflicting declaration 'typedef long 
unsigned int uint64'
  In file included from 
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvcore/nvcore.h:163:0,
                   from 
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvcore/Ptr.h:6,
                   from 
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:3:
  
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvcore/DefsGnucLinux.h:61:29:
 error: 'uint64' has a previous declaration as 'typedef long long unsigned int 
uint64'
  /build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp: In 
function 'nv::FloatImage* nv::ImageIO::loadFloat(const char*)':
  
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:138:10: 
warning: converting 'false' to pointer type 'nv::FloatImage*' 
[-Wconversion-null]
  /build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp: In 
function 'nv::Image* nv::ImageIO::loadTGA(nv::Stream&)':
  
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:236:12: 
warning: converting 'false' to pointer type 'nv::Image*' [-Wconversion-null]
  
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:257:11: 
warning: converting 'false' to pointer type 'nv::Image*' [-Wconversion-null]
  /build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp: In 
function 'nv::Image* nv::ImageIO::loadPNG(nv::Stream&)':
  
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:624:10: 
warning: converting 'false' to pointer type 'nv::Image*' [-Wconversion-null]
  
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:632:10: 
warning: converting 'false' to pointer type 'nv::Image*' [-Wconversion-null]
  
/build/buildd/nvidia-texture-tools-2.0.8-1+dfsg/src/nvimage/ImageIO.cpp:639:10: 
warning: converting 'false' to pointer type 'nv::Image*' [-Wconversion-null]
  make[3]: *** [src/nvimage/CMakeFiles/nvimage.dir/ImageIO.cpp.o] Error 1

This is because tiff 4.x exposes its own idea of int64 and uint64
typedefs in <tiff.h>, and this means that the ones in
nvidia-texture-tools have to match.

I trust my complaint in the following patch about typedeffing common
non-namespaced identifiers speaks for itself, although I realise it
should also go to the tiff maintainers!

  * Avoid int64/uint64 typedef clash with <tiff.h>.

diff -Nru 
nvidia-texture-tools-2.0.8-1+dfsg/debian/patches/int64-typedef-madness.patch 
nvidia-texture-tools-2.0.8-1+dfsg/debian/patches/int64-typedef-madness.patch
--- 
nvidia-texture-tools-2.0.8-1+dfsg/debian/patches/int64-typedef-madness.patch    
    1970-01-01 01:00:00.000000000 +0100
+++ 
nvidia-texture-tools-2.0.8-1+dfsg/debian/patches/int64-typedef-madness.patch    
    2012-10-04 17:53:36.000000000 +0100
@@ -0,0 +1,30 @@
+Description: Avoid int64/uint64 typedef clash with <tiff.h>
+ Both nvidia-texture-toolkit and tiff attempt to define their own int64 and
+ uint64 types.  As of libtiff 4.x, these are exported in <tiff.h>, and so we
+ have to make some attempt to get them to match.
+ .
+ Need I point out how terrible an idea it is to typedef standard-looking
+ names, rather than using your own namespace?
+Author: Colin Watson <cjwat...@ubuntu.com>
+Forwarded: no
+Last-Update: 2012-10-04
+
+Index: b/src/nvcore/DefsGnucLinux.h
+===================================================================
+--- a/src/nvcore/DefsGnucLinux.h
++++ b/src/nvcore/DefsGnucLinux.h
+@@ -58,8 +58,14 @@
+ typedef unsigned int        uint32;
+ typedef signed int          int32;
+ 
++#ifdef __LP64__
++// Avoid clash with libtiff
++typedef unsigned long       uint64;
++typedef signed long         int64;
++#else
+ typedef unsigned long long  uint64;
+ typedef signed long long    int64;
++#endif
+ 
+ // Aliases
+ typedef uint32              uint;
diff -Nru nvidia-texture-tools-2.0.8-1+dfsg/debian/patches/series 
nvidia-texture-tools-2.0.8-1+dfsg/debian/patches/series
--- nvidia-texture-tools-2.0.8-1+dfsg/debian/patches/series     2012-04-01 
12:00:51.000000000 +0100
+++ nvidia-texture-tools-2.0.8-1+dfsg/debian/patches/series     2012-10-04 
17:47:28.000000000 +0100
@@ -5,3 +5,4 @@
 05-fix-aliasing-bug.patch
 06-fix-libpng1.5-build.patch
 07-fix-valgrind.patch
+int64-typedef-madness.patch

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to