(svn r4019) -Fix: [OSX] stopped using iconv for 10.2.8, since it was added in 10.3

this have the sideeffect that 10.2.8 will still have the "failure to save with certain chars in the filename bug", but at least it can compile again
replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
bjarni 18 years ago
parent adab6f6438
commit 0b102f0e00

@ -486,8 +486,10 @@ endif
endif
ifdef OSX
ifndef JAGUAR
LIBS += -liconv
endif
endif
# enables/disables assert()
ifdef DISABLE_ASSERTS

@ -11,13 +11,10 @@
#ifdef ENABLE_NETWORK
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#if (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_2)
#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_2)
// OSX 10.2 don't have socklen_t defined, so we will define it here
typedef int socklen_t;
#endif
#endif
// Windows stuff
#if defined(WIN32) || defined(WIN64)

@ -23,16 +23,6 @@ endif
UNIVERSAL_BINARY:=1
endif
ifndef UNIVERSAL_BINARY
ifndef JAGUAR
ifeq ($(shell uname), Darwin)
# it's a hardware mac, not crosscompiling
$(shell $(CC) os/macosx/G5_detector.c -o os/macosx/G5_detector)
IS_G5:=$(shell os/macosx/G5_detector)
endif
endif
endif
ifdef UNIVERSAL_BINARY
ifndef STATIC
$(warning Compiling a universal binary, that is not static. Adding static flag)
@ -78,3 +68,19 @@ ifdef TRIPLE_BINARY
LDFLAGS += -arch ppc970
endif
endif
# setting up flags to make a binary, that fits the system it builds on
ifndef UNIVERSAL_BINARY
ifndef JAGUAR
ifeq ($(shell uname), Darwin)
# it's a hardware mac, not crosscompiling
# the next line fails if it got whitespace in front of it
$(shell $(CC) os/macosx/G5_detector.c -o os/macosx/G5_detector)
IS_G5:=$(shell os/macosx/G5_detector)
ifeq ($(shell uname -r), 6.8)
# OSX 10.2.8 uses Darwin 6.8, so we better set JAGUAR so we avoid the stuff that was added in 10.3 or later
JAGUAR:=1
endif
endif
endif
endif

@ -1314,7 +1314,7 @@ extern bool AfterLoadGame(void);
extern void BeforeSaveGame(void);
extern bool LoadOldSaveGame(const char *file);
#ifdef __APPLE__
#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
extern const char *convert_to_fs_charset(const char *filename);
#else
#define convert_to_fs_charset(str) (str)

@ -12,7 +12,7 @@
#include "screenshot.h"
#include "variables.h"
#ifdef __APPLE__
#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
extern const char *convert_to_fs_charset(const char *filename);
#else
#define convert_to_fs_charset(str) (str)

@ -43,8 +43,6 @@ ULONG __stack = (1024*1024)*2; // maybe not that much is needed actually ;)
#endif
#if defined(__APPLE__)
#include <iconv.h>
#include <locale.h>
#if defined(WITH_SDL)
//the mac implementation needs this file included in the same file as main()
#include <SDL.h>
@ -606,12 +604,15 @@ void CSleep(int milliseconds)
#endif // __AMIGA__
}
#ifdef __APPLE__
#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
/* FYI: This is not thread-safe.
Assumptions:
- the 'from' charset is ISO-8859-15
- the 'to' charset is either the same, or UTF-8
NOTE: iconv was added in OSX 10.3. 10.2.x will still have the invalid char issues. There aren't any easy fix for this
*/
#include <iconv.h>
#include <locale.h>
const char *convert_to_fs_charset(const char *filename)
{
static char statout[1024], statin[1024];

Loading…
Cancel
Save