mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Fix libjasper build with MSVC
This commit is contained in:
parent
6e6cfdd024
commit
d8015fd6ed
4
3rdparty/libjasper/CMakeLists.txt
vendored
4
3rdparty/libjasper/CMakeLists.txt
vendored
@ -23,8 +23,8 @@ if(MSVC)
|
||||
add_definitions(-DJAS_WIN_MSVC_BUILD)
|
||||
endif()
|
||||
|
||||
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 -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes -Wmissing-declarations -Wunused -Wshadow -Wsign-compare)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
|
||||
|
||||
if(UNIX)
|
||||
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 <limits.h>
|
||||
#include <errno.h>
|
||||
#ifndef _WIN32
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#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;
|
||||
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. */
|
||||
snprintf(obj->pathname, L_tmpnam, "%s/tmp.XXXXXXXXXX", P_tmpdir);
|
||||
|
||||
@ -371,6 +382,7 @@ jas_stream_t *jas_stream_tmpfile()
|
||||
jas_stream_destroy(stream);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Unlink the file so that it will disappear if the program
|
||||
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 {
|
||||
int fd;
|
||||
int flags;
|
||||
#if defined _WIN32 && !defined __MINGW__ && !defined __MINGW32__
|
||||
char pathname[MAX_PATH + 1];
|
||||
#else
|
||||
char pathname[PATH_MAX + 1];
|
||||
#endif
|
||||
} jas_stream_fileobj_t;
|
||||
|
||||
#define JAS_STREAM_FILEOBJ_DELONCLOSE 0x01
|
||||
|
Loading…
Reference in New Issue
Block a user