File xmp-compile.diff of Package libXMP4_4

Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/IPTC_Support.hpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FormatSupport/IPTC_Support.hpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/IPTC_Support.hpp
@@ -16,8 +16,9 @@
 
 #include "XMP_Const.h"
 #include "XMPFiles_Impl.hpp"
 #include "EndianUtils.hpp"
+#include <stdlib.h>
 
 // =================================================================================================
 /// \file IPTC_Support.hpp
 /// \brief XMPFiles support for IPTC (IIM) DataSets.
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/IPTC_Support.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FormatSupport/IPTC_Support.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/IPTC_Support.cpp
@@ -9,8 +9,9 @@
 
 #include "IPTC_Support.hpp"
 #include "EndianUtils.hpp"
 #include "Reconcile_Impl.hpp"
+#include <stdlib.h>
 
 // =================================================================================================
 /// \file IPTC_Support.cpp
 /// \brief XMPFiles support for IPTC (IIM) DataSets.
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/PSIR_FileWriter.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FormatSupport/PSIR_FileWriter.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/PSIR_FileWriter.cpp
@@ -10,8 +10,9 @@
 #include "PSIR_Support.hpp"
 #include "EndianUtils.hpp"
 
 #include <string.h>
+#include <stdlib.h>
 
 // =================================================================================================
 /// \file PSIR_FileWriter.cpp
 /// \brief Implementation of the file-based or read-write form of PSIR_Manager.
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/RIFF_Support.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FormatSupport/RIFF_Support.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/RIFF_Support.cpp
@@ -7,8 +7,9 @@
 // of the Adobe license agreement accompanying it.
 // =================================================================================================
 
 #include "RIFF_Support.hpp"
+#include <stdlib.h>
 
 #if XMP_WinBuild
 	#pragma warning ( disable : 4996 )	// '...' was declared deprecated
 #endif
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/PSIR_Support.hpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FormatSupport/PSIR_Support.hpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/PSIR_Support.hpp
@@ -16,8 +16,9 @@
 
 #include "XMP_Const.h"
 #include "XMPFiles_Impl.hpp"
 #include "EndianUtils.hpp"
+#include <stdlib.h>
 
 // =================================================================================================
 /// \file PSIR_Support.hpp
 /// \brief XMPFiles support for Photoshop image resources.
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/XMPScanner.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FormatSupport/XMPScanner.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FormatSupport/XMPScanner.cpp
@@ -21,8 +21,9 @@
 
 #include <cassert>
 #include <string>
 #include <cstdlib>
+#include <cstring>
 
 #if DEBUG
 	#include <iostream>
 	#include <iomanip>
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/XMPFiles_Impl.hpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/XMPFiles_Impl.hpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/XMPFiles_Impl.hpp
@@ -24,8 +24,9 @@
 #include "LargeFileAccess.hpp"
 
 #include <vector>
 #include <string>
+#include <cstring>
 #include <map>
 
 #include <cassert>
 
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/SonyHDV_Handler.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FileHandlers/SonyHDV_Handler.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/SonyHDV_Handler.cpp
@@ -9,8 +9,9 @@
 
 #include "SonyHDV_Handler.hpp"
 
 #include "MD5.h"
+#include <stdlib.h>
 
 #if XMP_WinBuild
 	#pragma warning ( disable : 4996 )	// '...' was declared deprecated
 #endif
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/P2_Handler.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FileHandlers/P2_Handler.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/P2_Handler.cpp
@@ -9,8 +9,9 @@
 
 #include "P2_Handler.hpp"
 
 #include "MD5.h"
+#include <stdlib.h>
 
 using namespace std;
 
 // =================================================================================================
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/PostScript_Handler.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FileHandlers/PostScript_Handler.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/PostScript_Handler.cpp
@@ -10,8 +10,10 @@
 #include "XMPScanner.hpp"
 
 #include "Scanner_Handler.hpp"
 #include "PostScript_Handler.hpp"
+#include <stdlib.h>
+#include <limits.h>
 
 using namespace std;
 
 // =================================================================================================
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/XDCAM_Handler.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FileHandlers/XDCAM_Handler.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/XDCAM_Handler.cpp
@@ -9,8 +9,9 @@
 
 #include "XDCAM_Handler.hpp"
 #include "XDCAM_Support.hpp"
 #include "MD5.h"
+#include <stdlib.h>
 
 using namespace std;
 
 // =================================================================================================
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/AVCHD_Handler.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FileHandlers/AVCHD_Handler.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/AVCHD_Handler.cpp
@@ -9,8 +9,9 @@
 
 #include "AVCHD_Handler.hpp"
 
 #include "MD5.h"
+#include <stdlib.h>
 
 using namespace std;
 
 // =================================================================================================
Index: XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/XDCAMEX_Handler.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPFiles/FileHandlers/XDCAMEX_Handler.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPFiles/FileHandlers/XDCAMEX_Handler.cpp
@@ -9,8 +9,9 @@
 
 #include "XDCAMEX_Handler.hpp"
 #include "XDCAM_Support.hpp"
 #include "MD5.h"
+#include <stdlib.h>
 
 using namespace std;
 
 // =================================================================================================
Index: XMP-Toolkit-SDK-4.4.2/source/common/LargeFileAccess.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/common/LargeFileAccess.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/common/LargeFileAccess.cpp
@@ -569,9 +569,9 @@ extern void			LFA_Throw	( const char* ms
 
 	void LFA_Close ( LFA_FileRef file )
 	{
 		if ( file == 0 ) return;	// Can happen if LFA_Open throws an exception.
-		int descr = (int)file;
+		long descr = (long)file;
 
 		int err = close ( descr );
 		if ( err != 0 ) LFA_Throw ( "LFA_Close: close failure", kLFAErr_ExternalFailure );
 
@@ -580,9 +580,9 @@ extern void			LFA_Throw	( const char* ms
 	// ---------------------------------------------------------------------------------------------
 
 	XMP_Int64 LFA_Seek ( LFA_FileRef file, XMP_Int64 offset, int mode, bool * okPtr )
 	{
-		int descr = (int)file;
+		long descr = (long)file;
 		
 		off_t newPos = lseek ( descr, offset, mode );
 		if ( okPtr != 0 ) {
 			*okPtr = (newPos != -1);
@@ -597,9 +597,9 @@ extern void			LFA_Throw	( const char* ms
 	// ---------------------------------------------------------------------------------------------
 
 	XMP_Int32 LFA_Read ( LFA_FileRef file, void * buffer, XMP_Int32 bytes, bool requireAll )
 	{
-		int descr = (int)file;
+		long descr = (long)file;
 		
 		ssize_t bytesRead = read ( descr, buffer, bytes );
 		if ( (bytesRead == -1) || (requireAll && (bytesRead != bytes)) ) LFA_Throw ( "LFA_Read: read failure", kLFAErr_ExternalFailure );
 		
@@ -610,9 +610,9 @@ extern void			LFA_Throw	( const char* ms
 	// ---------------------------------------------------------------------------------------------
 
 	void LFA_Write ( LFA_FileRef file, const void * buffer, XMP_Int32 bytes )
 	{
-		int descr = (int)file;
+		long descr = (long)file;
 
 		ssize_t bytesWritten = write ( descr, buffer, bytes );
 		if ( bytesWritten != bytes ) LFA_Throw ( "LFA_Write: write failure", kLFAErr_ExternalFailure );
 
@@ -621,9 +621,9 @@ extern void			LFA_Throw	( const char* ms
 	// ---------------------------------------------------------------------------------------------
 
 	void LFA_Flush ( LFA_FileRef file )
 	{
-		int descr = (int)file;
+		long descr = (long)file;
 
 		int err = fsync ( descr );
 		if ( err != 0 ) LFA_Throw ( "LFA_Flush: fsync failure", kLFAErr_ExternalFailure );
 
@@ -632,9 +632,9 @@ extern void			LFA_Throw	( const char* ms
 	// ---------------------------------------------------------------------------------------------
 
 	XMP_Int64 LFA_Measure ( LFA_FileRef file )
 	{
-		int descr = (int)file;
+		long descr = (long)file;
 		
 		off_t currPos = lseek ( descr, 0, SEEK_CUR );
 		off_t length  = lseek ( descr, 0, SEEK_END );
 		if ( (currPos == -1) || (length == -1) ) LFA_Throw ( "LFA_Measure: lseek failure", kLFAErr_ExternalFailure );
@@ -647,9 +647,9 @@ extern void			LFA_Throw	( const char* ms
 	// ---------------------------------------------------------------------------------------------
 
 	void LFA_Extend ( LFA_FileRef file, XMP_Int64 length )
 	{
-		int descr = (int)file;
+		long descr = (long)file;
 		
 		int err = ftruncate ( descr, length );
 		if ( err != 0 ) LFA_Throw ( "LFA_Extend: ftruncate failure", kLFAErr_ExternalFailure );
 
@@ -658,9 +658,9 @@ extern void			LFA_Throw	( const char* ms
 	// ---------------------------------------------------------------------------------------------
 
 	void LFA_Truncate ( LFA_FileRef file, XMP_Int64 length )
 	{
-		int descr = (int)file;
+		long descr = (long)file;
 		
 		int err = ftruncate ( descr, length );
 		if ( err != 0 ) LFA_Throw ( "LFA_Truncate: ftruncate failure", kLFAErr_ExternalFailure );
 
Index: XMP-Toolkit-SDK-4.4.2/source/XMPCore/XMPCore_Impl.hpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPCore/XMPCore_Impl.hpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPCore/XMPCore_Impl.hpp
@@ -8,15 +8,17 @@
 // NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the terms
 // of the Adobe license agreement accompanying it.
 // =================================================================================================
 
+
 #include "XMP_Environment.h"	// ! Must be the first #include!
 #include "XMP_Const.h"
 #include "XMP_BuildInfo.h"
 
 #include "client-glue/WXMPMeta.hpp"
 
 #include <vector>
+#include <cstring>
 #include <string>
 #include <map>
 
 #include <cassert>
Index: XMP-Toolkit-SDK-4.4.2/source/XMPCore/XMPCore_Impl.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/XMPCore/XMPCore_Impl.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/XMPCore/XMPCore_Impl.cpp
@@ -13,8 +13,9 @@
 
 #include "UnicodeInlines.incl_cpp"
 
 #include <algorithm>
+#include <cstring>
 
 using namespace std;
 
 #if XMP_WinBuild
Index: XMP-Toolkit-SDK-4.4.2/source/common/XML_Node.cpp
===================================================================
--- XMP-Toolkit-SDK-4.4.2.orig/source/common/XML_Node.cpp
+++ XMP-Toolkit-SDK-4.4.2/source/common/XML_Node.cpp
@@ -9,8 +9,9 @@
 #include "XMP_Environment.h"	// ! Must be the first #include!
 #include "XMLParserAdapter.hpp"
 
 #include <map>
+#include <cstring>
 
 // ! Can't include XMP..._Impl.hpp - used by both Core and Files.
 #define XMP_LitNMatch(s,l,n)	(std::strncmp((s),(l),(n)) == 0)