mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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:
@ -20,7 +20,7 @@ else:
|
||||
files += [ 'AlsaSoundStream.cpp' ]
|
||||
if env['HAVE_AO']:
|
||||
files += [ 'AOSoundStream.cpp' ]
|
||||
if env['HAVE_OPENAL']:
|
||||
if env['HAVE_OPENAL'] or sys.platform == 'win32':
|
||||
files += [ 'OpenALStream.cpp', 'aldlist.cpp' ]
|
||||
if env['HAVE_PULSEAUDIO']:
|
||||
files += [ 'PulseAudioStream.cpp' ]
|
||||
|
@ -5,8 +5,6 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#define PATH_MAX MAX_PATH
|
||||
|
||||
#elif __APPLE__
|
||||
#include <paths.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
@ -14,10 +12,8 @@
|
||||
#include <IOKit/storage/IOCDMedia.h>
|
||||
#include <IOKit/storage/IOMedia.h>
|
||||
#include <IOKit/IOBSD.h>
|
||||
|
||||
#elif __linux__
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/cdrom.h>
|
||||
@ -231,9 +227,9 @@ bool cdio_is_cdrom(std::string device)
|
||||
for (unsigned int i = 0; i < devices.size(); i++)
|
||||
{
|
||||
#ifdef __linux__
|
||||
if (strncmp(devices[i].c_str(), devname, PATH_MAX) == 0)
|
||||
if (strncmp(devices[i].c_str(), devname, MAX_PATH) == 0)
|
||||
#else
|
||||
if (strncmp(devices[i].c_str(), device.c_str(), PATH_MAX) == 0)
|
||||
if (strncmp(devices[i].c_str(), device.c_str(), MAX_PATH) == 0)
|
||||
#endif
|
||||
{
|
||||
res = true;
|
||||
|
@ -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_
|
||||
|
@ -19,19 +19,27 @@
|
||||
#define __OPENCL_H__
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
// OpenCL on Windows is linked through the CLRun library
|
||||
// It provides the headers and all the imports
|
||||
// It could be safe to use it for Linux too, but will require to edit the SCons first
|
||||
// OpenCL is linked on OSX when possible, it shouldn't require CLRun for now
|
||||
#ifdef _WIN32
|
||||
#define HAVE_OPENCL 1
|
||||
#endif
|
||||
|
||||
// The latest (last?) release of Xcode for Leopard does not include the 10.6
|
||||
// SDK, so we can only build with OpenCL on a Snow Leopard system where we link
|
||||
// the OpenCL framework weakly so that the application will also run on 10.5.
|
||||
#ifdef __APPLE__
|
||||
#import <Foundation/NSObjCRuntime.h>
|
||||
#ifdef NSFoundationVersionNumber10_5 // First defined in the 10.6 SDK
|
||||
#include <OpenCL/opencl.h>
|
||||
#define HAVE_OPENCL 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENCL) && HAVE_OPENCL
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <OpenCL/opencl.h>
|
||||
#else
|
||||
#ifndef __APPLE__
|
||||
#include <CL/cl.h>
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user