mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Build fix: Android NDK doesn't support any locale switching.
Also, Mac OS X doesn't support DX9.
This commit is contained in:
@ -516,8 +516,10 @@ const char *WriteLocation(API_TYPE ApiType)
|
|||||||
|
|
||||||
const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u32 components)
|
const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u32 components)
|
||||||
{
|
{
|
||||||
|
#ifndef ANDROID
|
||||||
locale_t locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation
|
locale_t locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation
|
||||||
locale_t old_locale = uselocale(locale); // Apply the locale for this thread
|
locale_t old_locale = uselocale(locale); // Apply the locale for this thread
|
||||||
|
#endif
|
||||||
text[sizeof(text) - 1] = 0x7C; // canary
|
text[sizeof(text) - 1] = 0x7C; // canary
|
||||||
|
|
||||||
BuildSwapModeTable(); // Needed for WriteStage
|
BuildSwapModeTable(); // Needed for WriteStage
|
||||||
@ -890,8 +892,10 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
|
|||||||
if (text[sizeof(text) - 1] != 0x7C)
|
if (text[sizeof(text) - 1] != 0x7C)
|
||||||
PanicAlert("PixelShader generator - buffer too small, canary has been eaten!");
|
PanicAlert("PixelShader generator - buffer too small, canary has been eaten!");
|
||||||
|
|
||||||
|
#ifndef ANDROID
|
||||||
uselocale(old_locale); // restore locale
|
uselocale(old_locale); // restore locale
|
||||||
freelocale(locale);
|
freelocale(locale);
|
||||||
|
#endif
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -807,8 +807,10 @@ void WriteZ24Encoder(char* p, API_TYPE ApiType)
|
|||||||
|
|
||||||
const char *GenerateEncodingShader(u32 format,API_TYPE ApiType)
|
const char *GenerateEncodingShader(u32 format,API_TYPE ApiType)
|
||||||
{
|
{
|
||||||
|
#ifndef ANDROID
|
||||||
locale_t locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation
|
locale_t locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation
|
||||||
locale_t old_locale = uselocale(locale); // Apply the locale for this thread
|
locale_t old_locale = uselocale(locale); // Apply the locale for this thread
|
||||||
|
#endif
|
||||||
text[sizeof(text) - 1] = 0x7C; // canary
|
text[sizeof(text) - 1] = 0x7C; // canary
|
||||||
|
|
||||||
char *p = text;
|
char *p = text;
|
||||||
@ -891,9 +893,11 @@ const char *GenerateEncodingShader(u32 format,API_TYPE ApiType)
|
|||||||
|
|
||||||
if (text[sizeof(text) - 1] != 0x7C)
|
if (text[sizeof(text) - 1] != 0x7C)
|
||||||
PanicAlert("TextureConversionShader generator - buffer too small, canary has been eaten!");
|
PanicAlert("TextureConversionShader generator - buffer too small, canary has been eaten!");
|
||||||
|
|
||||||
|
#ifndef ANDROID
|
||||||
uselocale(old_locale); // restore locale
|
uselocale(old_locale); // restore locale
|
||||||
freelocale(locale);
|
freelocale(locale);
|
||||||
|
#endif
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,8 +176,10 @@ extern const char *WriteLocation(API_TYPE ApiType);
|
|||||||
|
|
||||||
const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
|
const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
|
||||||
{
|
{
|
||||||
|
#ifndef ANDROID
|
||||||
locale_t locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation
|
locale_t locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation
|
||||||
locale_t old_locale = uselocale(locale); // Apply the locale for this thread
|
locale_t old_locale = uselocale(locale); // Apply the locale for this thread
|
||||||
|
#endif
|
||||||
text[sizeof(text) - 1] = 0x7C; // canary
|
text[sizeof(text) - 1] = 0x7C; // canary
|
||||||
|
|
||||||
_assert_(bpmem.genMode.numtexgens == xfregs.numTexGen.numTexGens);
|
_assert_(bpmem.genMode.numtexgens == xfregs.numTexGen.numTexGens);
|
||||||
@ -644,7 +646,9 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
|
|||||||
|
|
||||||
if (text[sizeof(text) - 1] != 0x7C)
|
if (text[sizeof(text) - 1] != 0x7C)
|
||||||
PanicAlert("VertexShader generator - buffer too small, canary has been eaten!");
|
PanicAlert("VertexShader generator - buffer too small, canary has been eaten!");
|
||||||
|
#ifndef ANDROID
|
||||||
uselocale(old_locale); // restore locale
|
uselocale(old_locale); // restore locale
|
||||||
freelocale(locale);
|
freelocale(locale);
|
||||||
|
#endif
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#ifdef __APPLE__
|
|
||||||
#include <xlocale.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "Hash.h"
|
#include "Hash.h"
|
||||||
@ -219,7 +216,7 @@ static LPDIRECT3DPIXELSHADER9 CreateCopyShader(int copyMatrixType, int depthConv
|
|||||||
WRITE(p, "}\n");
|
WRITE(p, "}\n");
|
||||||
if (text[sizeof(text) - 1] != 0x7C)
|
if (text[sizeof(text) - 1] != 0x7C)
|
||||||
PanicAlert("PixelShaderCache copy shader generator - buffer too small, canary has been eaten!");
|
PanicAlert("PixelShaderCache copy shader generator - buffer too small, canary has been eaten!");
|
||||||
|
|
||||||
uselocale(old_locale); // restore locale
|
uselocale(old_locale); // restore locale
|
||||||
freelocale(locale);
|
freelocale(locale);
|
||||||
return D3D::CompileAndCreatePixelShader(text, (int)strlen(text));
|
return D3D::CompileAndCreatePixelShader(text, (int)strlen(text));
|
||||||
|
Reference in New Issue
Block a user