On 20/01/2015 06:36, Larry Gritz wrote:
On Jan 15, 2015, at 12:20 PM, Shane Ambler <[email protected]>
wrote:
Both of the errors you get below appear to be from code in headers of
3rd party libraries we use. I don't get those errors on my end (and
not having FreeBSD, no way to test any proposed fixes). Does anybody
know the best way to address them?
For ffmpeg - this pairs up with adding __STDC_LIMIT_MACROS (1abc653325)
that we added in 1.4.10 (6/2014) In this case we only need to add
add_definitions ("-D__STDC_CONSTANT_MACROS") to CMakeLists.txt at line
74. You could leave it out as I can add it to CXXFLAGS in configure and
it is more related to third party linking.
For opencv - looking deeper I believe this is their issue and hasn't
changed in 3.0beta. They need to look at c++11 compatibility for their
code, for you it is just a heads up on the road to c++11 support.
https://github.com/Itseez/opencv/blob/master/modules/core/include/opencv2/core/types_c.h
From line 274 they have --
#define IPL_DEPTH_SIGN 0x80000000
#define IPL_DEPTH_1U 1
#define IPL_DEPTH_8U 8
#define IPL_DEPTH_16U 16
#define IPL_DEPTH_32F 32
#define IPL_DEPTH_8S (IPL_DEPTH_SIGN| 8)
#define IPL_DEPTH_16S (IPL_DEPTH_SIGN|16)
#define IPL_DEPTH_32S (IPL_DEPTH_SIGN|32)
Then in struct _IplImage then have -
int depth; /**< Pixel depth in bits: IPL_DEPTH_8U,
IPL_DEPTH_8S, IPL_DEPTH_16S,
IPL_DEPTH_32S, IPL_DEPTH_32F
and IPL_DEPTH_64F are supported. */
So they are deliberately putting signed and unsigned values into an int
I would think the defines should go into an enum and remove
IPL_DEPTH_SIGN but don't know what existing code that may break.
-- lg
Just done testing builds on FreeBSD - two small things
[ 83%] Building CXX object
src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/ffmpeg.imageio/ffmpeginput.cpp.o
In file included from
/usr/ports/graphics/openimageio/work/OpenImageIO-oiio-7aace95/src/ffmpeg.imageio/ffmpeginput.cpp:33:
In file included from
/usr/local/include/libavformat/avformat.h:255: In file included
from /usr/local/include/libavcodec/avcodec.h:31: In file included
from /usr/local/include/libavutil/samplefmt.h:24: In file included
from /usr/local/include/libavutil/avutil.h:289:
/usr/local/include/libavutil/common.h:30:2: error: missing
-D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS #error
missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
This falls similar to __STDC_LIMIT_MACROS which we added to
CXXFLAGS earlier.
If I enable USE_CP11 with clang 3.4.1 I get the following (would
normally leave it off for now, just testing) -
[ 21%] Building CXX object
src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebufalgo_opencv.cpp.o
/usr/ports/graphics/openimageio/work/OpenImageIO-oiio-7aace95/src/libOpenImageIO/imagebufalgo_opencv.cpp:75:10:
error: case value evaluates to 2147483664, which cannot be narrowed to
type 'int' [-Wc++11-narrowing]
case IPL_DEPTH_16S : ^
/usr/local/include/opencv2/core/types_c.h:443:23: note: expanded
from macro 'IPL_DEPTH_16S' #define IPL_DEPTH_16S
(IPL_DEPTH_SIGN|16) ^
/usr/ports/graphics/openimageio/work/OpenImageIO-oiio-7aace95/src/libOpenImageIO/imagebufalgo_opencv.cpp:71:10:
error: case value evaluates to 2147483656, which cannot be narrowed
to type 'int' [-Wc++11-narrowing] case IPL_DEPTH_8S : ^
/usr/local/include/opencv2/core/types_c.h:442:23: note: expanded
from macro 'IPL_DEPTH_8S' #define IPL_DEPTH_8S (IPL_DEPTH_SIGN|
8) ^
\ -- Larry Gritz [email protected]
_______________________________________________ Oiio-dev mailing
list [email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
FreeBSD - the place to B...Software Developing
Shane Ambler
--
FreeBSD - the place to B...Software Developing
Shane Ambler
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org