Author: post
Date: 2011-08-31 21:27:21 +0200 (Wed, 31 Aug 2011)
New Revision: 377

Modified:
   RawSpeed/Camera.cpp
   RawSpeed/CameraMetadataException.cpp
   RawSpeed/Common.cpp
   RawSpeed/Common.h
   RawSpeed/FileReader.cpp
   RawSpeed/OrfDecoder.cpp
   RawSpeed/SrwDecoder.cpp
   RawSpeed/StdAfx.h
Log:
Add support for Mac OS-X compilation. Thanks to jhegeman for original patch and 
Henrik Andersson for reporting.

Modified: RawSpeed/Camera.cpp
===================================================================
--- RawSpeed/Camera.cpp 2011-08-31 19:09:48 UTC (rev 376)
+++ RawSpeed/Camera.cpp 2011-08-31 19:27:21 UTC (rev 377)
@@ -223,7 +223,7 @@
 int Camera::StringToInt(const xmlChar *in, const xmlChar *tag, const char* 
attribute) {
   int i;
 
-#if defined(__unix__) || defined(__MINGW32__)
+#if defined(__unix__) || defined(__APPLE__) || defined(__MINGW32__)
   if (EOF == sscanf((const char*)in, "%d", &i))
 #else
   if (EOF == sscanf_s((const char*)in, "%d", &i))

Modified: RawSpeed/CameraMetadataException.cpp
===================================================================
--- RawSpeed/CameraMetadataException.cpp        2011-08-31 19:09:48 UTC (rev 
376)
+++ RawSpeed/CameraMetadataException.cpp        2011-08-31 19:27:21 UTC (rev 
377)
@@ -28,7 +28,7 @@
   va_list val;
   va_start(val, fmt);
   char buf[8192];
-#if defined(__unix__) || defined(__MINGW32__)
+#if defined(__unix__) || defined(__APPLE__) || defined(__MINGW32__)
   vsnprintf(buf, 8192, fmt, val);
 #else
   vsprintf_s(buf, 8192, fmt, val);

Modified: RawSpeed/Common.cpp
===================================================================
--- RawSpeed/Common.cpp 2011-08-31 19:09:48 UTC (rev 376)
+++ RawSpeed/Common.cpp 2011-08-31 19:27:21 UTC (rev 377)
@@ -22,7 +22,7 @@
     http://www.klauspost.com
 */
 
-#if defined(__unix__) || defined(__MINGW32__)
+#if defined(__unix__) || defined(__APPLE__) || defined(__MINGW32__) 
 
 void* _aligned_malloc(size_t bytes, size_t alignment) {
   void* ret= NULL;

Modified: RawSpeed/Common.h
===================================================================
--- RawSpeed/Common.h   2011-08-31 19:09:48 UTC (rev 376)
+++ RawSpeed/Common.h   2011-08-31 19:27:21 UTC (rev 377)
@@ -23,7 +23,7 @@
 #define COMMON_H
 
 
-#if !defined(__unix__) && !defined(__MINGW32__)
+#if !defined(__unix__) && !defined(__APPLE__) && !defined(__MINGW32__) 
 #include <intrin.h>
 #pragma intrinsic(_ReturnAddress)
 #define MIN(a,b) min(a,b)

Modified: RawSpeed/FileReader.cpp
===================================================================
--- RawSpeed/FileReader.cpp     2011-08-31 19:09:48 UTC (rev 376)
+++ RawSpeed/FileReader.cpp     2011-08-31 19:27:21 UTC (rev 377)
@@ -1,6 +1,6 @@
 #include "StdAfx.h"
 #include "FileReader.h"
-#ifdef __unix__
+#if defined(__unix__) || defined(__APPLE__) 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -35,7 +35,7 @@
 }
 
 FileMap* FileReader::readFile() {
-#ifdef __unix__
+#if defined(__unix__) || defined(__APPLE__) 
   int bytes_read = 0;
   FILE *file;
   char *dest;

Modified: RawSpeed/OrfDecoder.cpp
===================================================================
--- RawSpeed/OrfDecoder.cpp     2011-08-31 19:09:48 UTC (rev 376)
+++ RawSpeed/OrfDecoder.cpp     2011-08-31 19:27:21 UTC (rev 377)
@@ -1,7 +1,7 @@
 #include "StdAfx.h"
 #include "OrfDecoder.h"
 #include "TiffParserOlympus.h"
-#ifdef __unix__
+#if defined(__unix__) || defined(__APPLE__) 
 #include <stdlib.h>
 #endif
 /*

Modified: RawSpeed/SrwDecoder.cpp
===================================================================
--- RawSpeed/SrwDecoder.cpp     2011-08-31 19:09:48 UTC (rev 376)
+++ RawSpeed/SrwDecoder.cpp     2011-08-31 19:27:21 UTC (rev 377)
@@ -1,7 +1,7 @@
 #include "StdAfx.h"
 #include "SrwDecoder.h"
 #include "TiffParserOlympus.h"
-#ifdef __unix__
+#if defined(__unix__) || defined(__APPLE__) 
 #include <stdlib.h>
 #endif
 /*

Modified: RawSpeed/StdAfx.h
===================================================================
--- RawSpeed/StdAfx.h   2011-08-31 19:09:48 UTC (rev 376)
+++ RawSpeed/StdAfx.h   2011-08-31 19:27:21 UTC (rev 377)
@@ -30,7 +30,7 @@
 
 #define WIN32_LEAN_AND_MEAN            // Exclude rarely-used stuff from 
Windows headers
 #include <stdio.h>
-#ifndef __unix__
+#if !defined(__unix__) && !defined(__APPLE__) 
 #include <tchar.h>
 #include <io.h>
 #include <Windows.h>


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to