Fix libjasper build with MSVC
This commit is contained in:
		
							
								
								
									
										4
									
								
								3rdparty/libjasper/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								3rdparty/libjasper/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							@@ -23,8 +23,8 @@ if(MSVC)
 | 
				
			|||||||
  add_definitions(-DJAS_WIN_MSVC_BUILD)
 | 
					  add_definitions(-DJAS_WIN_MSVC_BUILD)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes -Wmissing-declarations -Wunused -Wshadow -Wsign-compare
 | 
					ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes -Wmissing-declarations -Wunused -Wshadow -Wsign-compare)
 | 
				
			||||||
                                   /wd4013 /wd4018 /wd4715 /wd4244 /wd4101 /wd4267)
 | 
					ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(UNIX)
 | 
					if(UNIX)
 | 
				
			||||||
  if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
 | 
					  if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								3rdparty/libjasper/jas_malloc.c
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								3rdparty/libjasper/jas_malloc.c
									
									
									
									
										vendored
									
									
								
							@@ -78,7 +78,9 @@
 | 
				
			|||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <limits.h>
 | 
					#include <limits.h>
 | 
				
			||||||
#include <errno.h>
 | 
					#include <errno.h>
 | 
				
			||||||
 | 
					#ifndef _WIN32
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "jasper/jas_malloc.h"
 | 
					#include "jasper/jas_malloc.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								3rdparty/libjasper/jas_stream.c
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								3rdparty/libjasper/jas_stream.c
									
									
									
									
										vendored
									
									
								
							@@ -363,6 +363,17 @@ jas_stream_t *jas_stream_tmpfile()
 | 
				
			|||||||
	obj->flags = 0;
 | 
						obj->flags = 0;
 | 
				
			||||||
	stream->obj_ = obj;
 | 
						stream->obj_ = obj;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef _WIN32
 | 
				
			||||||
 | 
						/* Choose a file name. */
 | 
				
			||||||
 | 
						tmpnam(obj->pathname);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Open the underlying file. */
 | 
				
			||||||
 | 
						if ((obj->fd = open(obj->pathname, O_CREAT | O_EXCL | O_RDWR | O_TRUNC | O_BINARY,
 | 
				
			||||||
 | 
						  JAS_STREAM_PERMS)) < 0) {
 | 
				
			||||||
 | 
							jas_stream_destroy(stream);
 | 
				
			||||||
 | 
							return 0;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
	/* Choose a file name. */
 | 
						/* Choose a file name. */
 | 
				
			||||||
	snprintf(obj->pathname, L_tmpnam, "%s/tmp.XXXXXXXXXX", P_tmpdir);
 | 
						snprintf(obj->pathname, L_tmpnam, "%s/tmp.XXXXXXXXXX", P_tmpdir);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -371,6 +382,7 @@ jas_stream_t *jas_stream_tmpfile()
 | 
				
			|||||||
		jas_stream_destroy(stream);
 | 
							jas_stream_destroy(stream);
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Unlink the file so that it will disappear if the program
 | 
						/* Unlink the file so that it will disappear if the program
 | 
				
			||||||
	terminates abnormally. */
 | 
						terminates abnormally. */
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								3rdparty/libjasper/jasper/jas_stream.h
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								3rdparty/libjasper/jasper/jas_stream.h
									
									
									
									
										vendored
									
									
								
							@@ -252,7 +252,11 @@ typedef struct {
 | 
				
			|||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	int fd;
 | 
						int fd;
 | 
				
			||||||
	int flags;
 | 
						int flags;
 | 
				
			||||||
 | 
					#if defined _WIN32 && !defined __MINGW__ && !defined __MINGW32__
 | 
				
			||||||
 | 
						char pathname[MAX_PATH + 1];
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
	char pathname[PATH_MAX + 1];
 | 
						char pathname[PATH_MAX + 1];
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
} jas_stream_fileobj_t;
 | 
					} jas_stream_fileobj_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define	JAS_STREAM_FILEOBJ_DELONCLOSE	0x01
 | 
					#define	JAS_STREAM_FILEOBJ_DELONCLOSE	0x01
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user