! : changed
+ : 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
! [antonin] xcode : changed to native architecture build by default
* [antonin] reverted 'include "../opj_config.h"' to 'include "opj_config.h"'
Utility functions
==========================================================*/
-#if !defined(_MSC_VER) && !defined(__MINGW32__)
+#ifndef _WIN32
static char*
i2a(unsigned i, char *a, unsigned r) {
if (i/r > 0) a = i2a(i/r,a,r);
return a;
}
-#endif /* !WIN32 */
+#endif /* !_WIN32 */
/* ----------------------------------------------------------------------- */
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#else
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/times.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
#include "opj_includes.h"
double opj_clock(void) {
-#ifdef WIN32
- /* WIN32: use QueryPerformance (very accurate) */
+#ifdef _WIN32
+ /* _WIN32: use QueryPerformance (very accurate) */
LARGE_INTEGER freq , t ;
/* freq is the clock speed of the CPU */
QueryPerformanceFrequency(&freq) ;
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
-#endif /* WIN32 */
+#endif /* _WIN32 */
#include "opj_config.h"
#include "opj_includes.h"
/* ---------------------------------------------------------------------- */
-#ifdef WIN32
+#ifdef _WIN32
#ifndef OPJ_STATIC
BOOL APIENTRY
DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
return TRUE;
}
#endif /* OPJ_STATIC */
-#endif /* WIN32 */
+#endif /* _WIN32 */
/* ---------------------------------------------------------------------- */
==========================================================
*/
-#if defined(OPJ_STATIC) || !(defined(WIN32) || defined(__WIN32__))
+#if defined(OPJ_STATIC) || !defined(_WIN32)
#define OPJ_API
#define OPJ_CALLCONV
#else
OPJ_API functions as being imported from a DLL, wheras this DLL sees symbols
defined with this macro as being exported.
*/
-#ifdef OPJ_EXPORTS
+#if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
#define OPJ_API __declspec(dllexport)
#else
#define OPJ_API __declspec(dllimport)
#endif /* OPJ_EXPORTS */
-#endif /* !OPJ_STATIC || !WIN32 */
+#endif /* !OPJ_STATIC || !_WIN32 */
#ifndef __cplusplus
#if defined(HAVE_STDBOOL_H)
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available\r
*/\r
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */\r
-#ifdef WIN32\r
+#ifdef _WIN32\r
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */\r
#ifdef __GNUC__\r
#include <mm_malloc.h>\r
#define HAVE_MM_MALLOC\r
#endif\r
#endif\r
-#else /* Not WIN32 */\r
+#else /* Not _WIN32 */\r
#if defined(__sun)\r
#define HAVE_MEMALIGN\r
/* Linux x86_64 and OSX always align allocations to 16 bytes */\r