Allow full-length Unix pathnames.

Move bits of HAVE_OPENCL/HAVE_WX for OS X from SConstruct to header files.

Use /usr/lib/libz on OS X now that we no longer have -L/opt/local/lib in
the library path. It is still possible that we could pick up a libz in
/usr/local/lib that would make the application non-redistributable, but
the danger is much less than previously.

Also bits of minor portability cleanup.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5868 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2010-07-10 21:17:08 +00:00
parent 379706b25a
commit addb89fecc
8 changed files with 79 additions and 87 deletions

View File

@ -36,42 +36,45 @@ extern const char *netplay_dolphin_ver;
#define LOGGING 1
#endif
#define STACKALIGN
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
#include "Log.h"
#include "CommonTypes.h"
#include "MsgHandler.h"
#include "CommonPaths.h"
#include "CommonFuncs.h"
#ifdef _MSC_VER
#define __strdup _strdup
#define __getcwd _getcwd
#define __chdir _chdir
#else
#define __strdup strdup
#define __getcwd getcwd
#define __chdir chdir
#ifdef __APPLE__
// The Darwin ABI requires that stack frames be aligned to 16-byte boundaries.
// This is only needed on i386 gcc - x86_64 already aligns to 16 bytes.
#if defined __i386__ && defined __GNUC__
#undef STACKALIGN
#define STACKALIGN __attribute__((__force_align_arg_pointer__))
#endif
// We use wxWidgets on OS X only if it is version 2.9+ with Cocoa support.
#ifdef __WXOSX_COCOA__
#define HAVE_WX 1
#define USE_WX 1 // Use wxGLCanvas
#endif
// Darwin ABI requires that stack frames be aligned to 16-byte boundaries.
// This is only needed on i386 gcc - x86_64 already aligns to 16bytes
#if defined(__APPLE__) && defined(__i386__) && defined(__GNUC__)
#define STACKALIGN __attribute__((__force_align_arg_pointer__))
#else
#define STACKALIGN
#endif
#elif defined _WIN32
#ifdef _WIN32
// Check MSC ver
#if !defined _MSC_VER || _MSC_VER <= 1000
#error needs at least version 1000 of MSC
#endif
#define NOMINMAX
// Memory leak checks
#define CHECK_HEAP_INTEGRITY()
#define POSIX 0
#define NOMINMAX
// Alignment
#define GC_ALIGNED16(x) __declspec(align(16)) x
#define GC_ALIGNED32(x) __declspec(align(32)) x
@ -83,8 +86,6 @@ extern const char *netplay_dolphin_ver;
#define HAVE_WIIUSE 1
#define HAVE_WX 1
#define HAVE_OPENAL 1
#define HAVE_ALSA 0
#define HAVE_PORTAUDIO 0
// it is VERY DANGEROUS to mix _SECURE_SCL=0 and _SECURE_SCL=1 compiled libraries.
// You will get bizarre crash bugs whenever you use STL.
@ -109,42 +110,39 @@ extern const char *netplay_dolphin_ver;
//CrtDebugBreak breakAt(614);
#endif // end DEBUG/FAST
#else // Not windows
#ifdef __APPLE__
#if defined HAVE_WX && HAVE_WX
#define MAP_32BIT 0 // MAP_32BIT is a Linux-specific mmap(2) flag
#define USE_WX 1 // Use wxGLCanvas
#endif // HAVE_WX
#else // __APPLE__
#else
#include "Config.h" // SCons autoconfiguration defines
#endif
// General defines
#define POSIX 1
#define MAX_PATH 260
#ifndef __linux__
#define MAP_32BIT 0 // MAP_32BIT is a Linux-specific mmap(2) flag
#endif
// Windows compatibility
#define __forceinline inline __attribute__((always_inline))
#ifndef _WIN32
#include <limits.h>
#define MAX_PATH PATH_MAX
#ifdef _LP64
#define _M_X64 1
#else
#define _M_IX86 1
#endif
#define __forceinline inline __attribute__((always_inline))
#define GC_ALIGNED16(x) __attribute__((aligned(16))) x
#define GC_ALIGNED32(x) __attribute__((aligned(32))) x
#define GC_ALIGNED64(x) __attribute__((aligned(64))) x
#define GC_ALIGNED16_DECL(x) __attribute__((aligned(16))) x
#define GC_ALIGNED64_DECL(x) __attribute__((aligned(64))) x
#endif
#ifdef _LP64
#define _M_X64 1
#else
#define _M_IX86 1
#endif
// Alignment
#define GC_ALIGNED16(x) __attribute__((aligned(16))) x
#define GC_ALIGNED32(x) __attribute__((aligned(32))) x
#define GC_ALIGNED64(x) __attribute__((aligned(64))) x
#define GC_ALIGNED16_DECL(x) __attribute__((aligned(16))) x
#define GC_ALIGNED64_DECL(x) __attribute__((aligned(64))) x
#endif // WIN32
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
#ifdef _MSC_VER
#define __strdup _strdup
#define __getcwd _getcwd
#define __chdir _chdir
#else
#define __strdup strdup
#define __getcwd getcwd
#define __chdir chdir
#endif
#endif // _COMMON_H_