fix compilation and DLL creation of libopenjpeg with MSYS/MinGW (from vincent.torri, see issue 47 on googlecode)
This commit is contained in:
parent
2b31495723
commit
389166e86e
3
CHANGES
3
CHANGES
|
@ -5,6 +5,9 @@ What's New for OpenJPEG
|
||||||
! : changed
|
! : changed
|
||||||
+ : added
|
+ : added
|
||||||
|
|
||||||
|
November 25, 2010
|
||||||
|
* [antonin] fix compilation and DLL creation of libopenjpeg with MSYS/MinGW (from vincent.torri, see issue 47 on googlecode)
|
||||||
|
|
||||||
November 22, 2010
|
November 22, 2010
|
||||||
! [antonin] xcode : changed to native architecture build by default
|
! [antonin] xcode : changed to native architecture build by default
|
||||||
* [antonin] reverted 'include "../opj_config.h"' to 'include "opj_config.h"'
|
* [antonin] reverted 'include "../opj_config.h"' to 'include "opj_config.h"'
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
Utility functions
|
Utility functions
|
||||||
==========================================================*/
|
==========================================================*/
|
||||||
|
|
||||||
#if !defined(_MSC_VER) && !defined(__MINGW32__)
|
#ifndef _WIN32
|
||||||
static char*
|
static char*
|
||||||
i2a(unsigned i, char *a, unsigned r) {
|
i2a(unsigned i, char *a, unsigned r) {
|
||||||
if (i/r > 0) a = i2a(i/r,a,r);
|
if (i/r > 0) a = i2a(i/r,a,r);
|
||||||
|
@ -57,7 +57,7 @@ _itoa(int i, char *a, int r) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !WIN32 */
|
#endif /* !_WIN32 */
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -24,18 +24,18 @@
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
#endif /* WIN32 */
|
#endif /* _WIN32 */
|
||||||
#include "opj_includes.h"
|
#include "opj_includes.h"
|
||||||
|
|
||||||
double opj_clock(void) {
|
double opj_clock(void) {
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
/* WIN32: use QueryPerformance (very accurate) */
|
/* _WIN32: use QueryPerformance (very accurate) */
|
||||||
LARGE_INTEGER freq , t ;
|
LARGE_INTEGER freq , t ;
|
||||||
/* freq is the clock speed of the CPU */
|
/* freq is the clock speed of the CPU */
|
||||||
QueryPerformanceFrequency(&freq) ;
|
QueryPerformanceFrequency(&freq) ;
|
||||||
|
|
|
@ -24,15 +24,15 @@
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif /* WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
#include "opj_config.h"
|
#include "opj_config.h"
|
||||||
#include "opj_includes.h"
|
#include "opj_includes.h"
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#ifndef OPJ_STATIC
|
#ifndef OPJ_STATIC
|
||||||
BOOL APIENTRY
|
BOOL APIENTRY
|
||||||
DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
||||||
|
@ -49,7 +49,7 @@ DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif /* OPJ_STATIC */
|
#endif /* OPJ_STATIC */
|
||||||
#endif /* WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
==========================================================
|
==========================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(OPJ_STATIC) || !(defined(WIN32) || defined(__WIN32__))
|
#if defined(OPJ_STATIC) || !defined(_WIN32)
|
||||||
#define OPJ_API
|
#define OPJ_API
|
||||||
#define OPJ_CALLCONV
|
#define OPJ_CALLCONV
|
||||||
#else
|
#else
|
||||||
|
@ -52,12 +52,12 @@ that uses this DLL. This way any other project whose source files include this f
|
||||||
OPJ_API functions as being imported from a DLL, wheras this DLL sees symbols
|
OPJ_API functions as being imported from a DLL, wheras this DLL sees symbols
|
||||||
defined with this macro as being exported.
|
defined with this macro as being exported.
|
||||||
*/
|
*/
|
||||||
#ifdef OPJ_EXPORTS
|
#if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
|
||||||
#define OPJ_API __declspec(dllexport)
|
#define OPJ_API __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define OPJ_API __declspec(dllimport)
|
#define OPJ_API __declspec(dllimport)
|
||||||
#endif /* OPJ_EXPORTS */
|
#endif /* OPJ_EXPORTS */
|
||||||
#endif /* !OPJ_STATIC || !WIN32 */
|
#endif /* !OPJ_STATIC || !_WIN32 */
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
#if defined(HAVE_STDBOOL_H)
|
#if defined(HAVE_STDBOOL_H)
|
||||||
|
|
|
@ -69,7 +69,7 @@ Allocate memory aligned to a 16 byte boundry
|
||||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||||
*/
|
*/
|
||||||
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
|
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
|
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#include <mm_malloc.h>
|
#include <mm_malloc.h>
|
||||||
|
@ -80,7 +80,7 @@ Allocate memory aligned to a 16 byte boundry
|
||||||
#define HAVE_MM_MALLOC
|
#define HAVE_MM_MALLOC
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#else /* Not WIN32 */
|
#else /* Not _WIN32 */
|
||||||
#if defined(__sun)
|
#if defined(__sun)
|
||||||
#define HAVE_MEMALIGN
|
#define HAVE_MEMALIGN
|
||||||
/* Linux x86_64 and OSX always align allocations to 16 bytes */
|
/* Linux x86_64 and OSX always align allocations to 16 bytes */
|
||||||
|
|
Loading…
Reference in New Issue