Preventing duplicate objects error in ByteArray.h

This commit is contained in:
MattTuttle
2014-07-08 15:55:03 -05:00
parent 5ef9f9809d
commit fdec74b87a
3 changed files with 3 additions and 47 deletions

View File

@@ -67,28 +67,7 @@ namespace lime {
extern int gFixedOrientation;
#elif defined(HX_MACOS)
#include <CoreFoundation/CoreFoundation.h>
FILE *OpenRead(const char *inName)
{
FILE *result = fopen(inName,"rb");
if (!result) {
CFStringRef str = CFStringCreateWithCString(NULL, inName, kCFStringEncodingUTF8);
CFURLRef path = CFBundleCopyResourceURL(CFBundleGetMainBundle(), str, NULL, NULL);
CFRelease(str);
if (path) {
str = CFURLCopyPath(path);
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str),kCFStringEncodingUTF8);
char *buffer = (char *)malloc(maxSize);
if (CFStringGetCString(str, buffer, maxSize, kCFStringEncodingUTF8)) {
result = fopen(buffer,"rb");
free(buffer);
}
CFRelease(str);
CFRelease(path);
}
}
return result;
}
FILE *OpenRead(const char *inName);
#define OpenOverwrite(x) fopen(x,"wb")
#else
#ifdef TIZEN