diff options
author | Hubert Figuière <hub@figuiere.net> | 2014-09-01 17:00:01 -0400 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2014-09-01 17:00:01 -0400 |
commit | 6fe1a0d7e3bcb01efd1094dc1d5198540c1d7e18 (patch) | |
tree | ad564e12a1407c03cd8c4bd24e3519dcdfdae098 /XMPFiles | |
parent | 3cc479d6c3bef6d1d42fd94c44d9dee2c2bab229 (diff) |
Fix a boatload of compile in the XMP SDK.
Diffstat (limited to 'XMPFiles')
-rw-r--r-- | XMPFiles/source/FormatSupport/ID3_Support.cpp | 21 | ||||
-rw-r--r-- | XMPFiles/source/FormatSupport/ID3_Support.hpp | 19 | ||||
-rw-r--r-- | XMPFiles/source/FormatSupport/Reconcile_Impl.cpp | 2 | ||||
-rw-r--r-- | XMPFiles/source/FormatSupport/Reconcile_Impl.hpp | 2 | ||||
-rw-r--r-- | XMPFiles/source/FormatSupport/TIFF_Support.cpp | 4 | ||||
-rw-r--r-- | XMPFiles/source/FormatSupport/TIFF_Support.hpp | 4 | ||||
-rw-r--r-- | XMPFiles/source/XMPFiles_Impl.hpp | 6 |
7 files changed, 32 insertions, 26 deletions
diff --git a/XMPFiles/source/FormatSupport/ID3_Support.cpp b/XMPFiles/source/FormatSupport/ID3_Support.cpp index 97f8403..fc482ba 100644 --- a/XMPFiles/source/FormatSupport/ID3_Support.cpp +++ b/XMPFiles/source/FormatSupport/ID3_Support.cpp @@ -20,6 +20,27 @@ #define MIN(a,b) ((a) < (b) ? (a) : (b)) +#if !XMP_WinBuild + int stricmp ( const char * left, const char * right ) // Case insensitive ASCII compare. + { + char chL = *left; // ! Allow for 0 passes in the loop (one string is empty). + char chR = *right; // ! Return -1 for stricmp ( "a", "Z" ). + + for ( ; (*left != 0) && (*right != 0); ++left, ++right ) { + chL = *left; + chR = *right; + if ( chL == chR ) continue; + if ( ('A' <= chL) && (chL <= 'Z') ) chL |= 0x20; + if ( ('A' <= chR) && (chR <= 'Z') ) chR |= 0x20; + if ( chL != chR ) break; + } + + if ( chL == chR ) return 0; + if ( chL < chR ) return -1; + return 1; + } +#endif + namespace ID3_Support { // ================================================================================================= diff --git a/XMPFiles/source/FormatSupport/ID3_Support.hpp b/XMPFiles/source/FormatSupport/ID3_Support.hpp index 5228fd7..1ca3107 100644 --- a/XMPFiles/source/FormatSupport/ID3_Support.hpp +++ b/XMPFiles/source/FormatSupport/ID3_Support.hpp @@ -18,24 +18,7 @@ #if XMP_WinBuild #define stricmp _stricmp #else - static int stricmp ( const char * left, const char * right ) // Case insensitive ASCII compare. - { - char chL = *left; // ! Allow for 0 passes in the loop (one string is empty). - char chR = *right; // ! Return -1 for stricmp ( "a", "Z" ). - - for ( ; (*left != 0) && (*right != 0); ++left, ++right ) { - chL = *left; - chR = *right; - if ( chL == chR ) continue; - if ( ('A' <= chL) && (chL <= 'Z') ) chL |= 0x20; - if ( ('A' <= chR) && (chR <= 'Z') ) chR |= 0x20; - if ( chL != chR ) break; - } - - if ( chL == chR ) return 0; - if ( chL < chR ) return -1; - return 1; - } + int stricmp ( const char * left, const char * right ); // Case insensitive ASCII compare. #endif // ================================================================================================= diff --git a/XMPFiles/source/FormatSupport/Reconcile_Impl.cpp b/XMPFiles/source/FormatSupport/Reconcile_Impl.cpp index 9dcef3d..bf23e6f 100644 --- a/XMPFiles/source/FormatSupport/Reconcile_Impl.cpp +++ b/XMPFiles/source/FormatSupport/Reconcile_Impl.cpp @@ -19,6 +19,8 @@ #include <CoreServices/CoreServices.h> #endif +const char * ReconcileUtils::kHexDigits = "0123456789ABCDEF"; + // ================================================================================================= /// \file Reconcile_Impl.cpp /// \brief Implementation utilities for the photo metadata reconciliation support. diff --git a/XMPFiles/source/FormatSupport/Reconcile_Impl.hpp b/XMPFiles/source/FormatSupport/Reconcile_Impl.hpp index ea5d407..22c5edc 100644 --- a/XMPFiles/source/FormatSupport/Reconcile_Impl.hpp +++ b/XMPFiles/source/FormatSupport/Reconcile_Impl.hpp @@ -33,7 +33,7 @@ namespace ReconcileUtils { // *** These ought to be with the Unicode conversions. - static const char * kHexDigits = "0123456789ABCDEF"; + extern const char * kHexDigits; bool IsASCII ( const void * _textPtr, size_t textLen ); bool IsUTF8 ( const void * _textPtr, size_t textLen ); diff --git a/XMPFiles/source/FormatSupport/TIFF_Support.cpp b/XMPFiles/source/FormatSupport/TIFF_Support.cpp index da2f9b6..22f3cf3 100644 --- a/XMPFiles/source/FormatSupport/TIFF_Support.cpp +++ b/XMPFiles/source/FormatSupport/TIFF_Support.cpp @@ -16,6 +16,10 @@ #include "source/UnicodeConversions.hpp" +static const char * kTIFF_TypeNames[] = { "ShortOrLong", "BYTE", "ASCII", "SHORT", "LONG", "RATIONAL", + "SBYTE", "UNDEFINED", "SSHORT", "SLONG", "SRATIONAL", + "FLOAT", "DOUBLE" }; + // ================================================================================================= /// \file TIFF_Support.cpp /// \brief Manager for parsing and serializing TIFF streams. diff --git a/XMPFiles/source/FormatSupport/TIFF_Support.hpp b/XMPFiles/source/FormatSupport/TIFF_Support.hpp index 002376b..2c66842 100644 --- a/XMPFiles/source/FormatSupport/TIFF_Support.hpp +++ b/XMPFiles/source/FormatSupport/TIFF_Support.hpp @@ -100,10 +100,6 @@ static const bool kTIFF_IsIntegerType[] = { 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, static const bool kTIFF_IsRationalType[] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 }; static const bool kTIFF_IsFloatType[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 }; -static const char * kTIFF_TypeNames[] = { "ShortOrLong", "BYTE", "ASCII", "SHORT", "LONG", "RATIONAL", - "SBYTE", "UNDEFINED", "SSHORT", "SLONG", "SRATIONAL", - "FLOAT", "DOUBLE" }; - enum { // Encodings for SetTag_EncodedString. kTIFF_EncodeUndefined = 0, kTIFF_EncodeASCII = 1, diff --git a/XMPFiles/source/XMPFiles_Impl.hpp b/XMPFiles/source/XMPFiles_Impl.hpp index 6e21c23..f75df3f 100644 --- a/XMPFiles/source/XMPFiles_Impl.hpp +++ b/XMPFiles/source/XMPFiles_Impl.hpp @@ -149,11 +149,11 @@ extern XMP_StringPtr voidStringPtr; extern XMP_StringLen voidStringLen; extern XMP_OptionBits voidOptionBits; -static const XMP_Uns8 * kUTF8_PacketStart = (const XMP_Uns8 *) "<?xpacket begin="; -static const XMP_Uns8 * kUTF8_PacketID = (const XMP_Uns8 *) "W5M0MpCehiHzreSzNTczkc9d"; +#define kUTF8_PacketStart (const XMP_Uns8 *)"<?xpacket begin=" +#define kUTF8_PacketID (const XMP_Uns8 *)"W5M0MpCehiHzreSzNTczkc9d" static const size_t kUTF8_PacketHeaderLen = 51; // ! strlen ( "<?xpacket begin='xxx' id='W5M0MpCehiHzreSzNTczkc9d'" ) -static const XMP_Uns8 * kUTF8_PacketTrailer = (const XMP_Uns8 *) "<?xpacket end=\"w\"?>"; +#define kUTF8_PacketTrailer (const XMP_Uns8 *)"<?xpacket end=\"w\"?>" static const size_t kUTF8_PacketTrailerLen = 19; // ! strlen ( kUTF8_PacketTrailer ) struct FileExtMapping { |