Prevent Python from stripping off the final newline of the main(){}

autoconfiguration tests. Some versions of gcc care enough about ANSI C
to complain about this.
 
Use the Linux install hierarchy conventions on other Unices as well.
 
XKeysymToString returns NULL on unknown keysyms, which is not a valid
std::string initializer.
 
There appears to be some disagreement regarding the second parameter
to iconv(). Some versions/installations have it as const, others don't.
Unfortunately, due to wonderful C++ brain damage, implicit conversion 
from const to non-const doesn't work here.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5945 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang 2010-07-22 07:55:35 +00:00
parent 6c7e666a75
commit 09b5dfbd53
11 changed files with 27 additions and 17 deletions

View File

@ -17,7 +17,7 @@ def CheckLib(context, name):
int main(int argc, char **argv) { int main(int argc, char **argv) {
return 0; return 0;
} }
""", '.c') \n""", '.c')
if not ret: if not ret:
context.env.Replace(LIBS = lastLIBS) context.env.Replace(LIBS = lastLIBS)
@ -72,7 +72,7 @@ def CheckPortaudio(context, version):
printf("%d", Pa_GetVersion()); printf("%d", Pa_GetVersion());
return 0; return 0;
} }
""", '.c')[1] \n""", '.c')[1]
if found: if found:
ret = (version <= found) ret = (version <= found)

View File

@ -652,13 +652,11 @@ const char *GetUserPath(int DirIDX)
#ifdef _WIN32 #ifdef _WIN32
// Keep the directory setup the way it was on windows // Keep the directory setup the way it was on windows
snprintf(UserDir, sizeof(UserDir), ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP); snprintf(UserDir, sizeof(UserDir), ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP);
#elif defined (__linux__) #else
if (File::Exists(ROOT_DIR DIR_SEP USERDATA_DIR)) if (File::Exists(ROOT_DIR DIR_SEP USERDATA_DIR))
snprintf(UserDir, sizeof(UserDir), ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP); snprintf(UserDir, sizeof(UserDir), ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP);
else else
snprintf(UserDir, sizeof(UserDir), "%s" DIR_SEP DOLPHIN_DATA_DIR DIR_SEP, getenv("HOME")); snprintf(UserDir, sizeof(UserDir), "%s" DIR_SEP DOLPHIN_DATA_DIR DIR_SEP, getenv("HOME"));
#else
snprintf(UserDir, sizeof(UserDir), "%s" DIR_SEP DOLPHIN_DATA_DIR DIR_SEP, getenv("HOME"));
#endif #endif
INFO_LOG(COMMON, "GetUserPath: Setting user directory to %s:", UserDir); INFO_LOG(COMMON, "GetUserPath: Setting user directory to %s:", UserDir);

View File

@ -82,8 +82,10 @@ bool CEXIETHERNET::activate() {
system("brctl addif pan0 Dolphin"); system("brctl addif pan0 Dolphin");
system("ifconfig Dolphin 0.0.0.0 promisc up"); system("ifconfig Dolphin 0.0.0.0 promisc up");
resume(); resume();
#endif
return true; return true;
#else
return false;
#endif
} }
bool CEXIETHERNET::CheckRecieved() bool CEXIETHERNET::CheckRecieved()
{ {

View File

@ -31,6 +31,13 @@
#include <errno.h> #include <errno.h>
#endif #endif
#ifdef __FreeBSD__
#define ICONV_CONST const
#endif
#ifndef ICONV_CONST
#define ICONV_CONST
#endif
namespace DiscIO namespace DiscIO
{ {
void IBannerLoader::CopyToStringAndCheck(std::string& _rDestination, const char* _src) void IBannerLoader::CopyToStringAndCheck(std::string& _rDestination, const char* _src)
@ -154,7 +161,9 @@ bool IBannerLoader::CopyBeUnicodeToString( std::string& _rDestination, const u16
char* utf8_buffer_start = utf8_buffer; char* utf8_buffer_start = utf8_buffer;
char* src_buffer_start = src_buffer; char* src_buffer_start = src_buffer;
size_t iconv_size = iconv(conv_desc, &src_buffer, &inbytes, &utf8_buffer, &outbytes); size_t iconv_size = iconv(conv_desc,
(ICONV_CONST char**)&src_buffer, &inbytes,
&utf8_buffer, &outbytes);
// Handle failures // Handle failures
if (iconv_size == (size_t) -1) if (iconv_size == (size_t) -1)

View File

@ -113,9 +113,10 @@ KeyboardMouse::Key::Key(Display* const display, KeyCode keycode)
if (keysym >= 97 && keysym <= 122) if (keysym >= 97 && keysym <= 122)
keysym -= 32; keysym -= 32;
// 0x0110ffff is the top of the unicode character range according to keysymdef.h // 0x0110ffff is the top of the unicode character range according
// although it is probably more than we need. // to keysymdef.h although it is probably more than we need.
if (keysym == NoSymbol || keysym > 0x0110ffff) if (keysym == NoSymbol || keysym > 0x0110ffff ||
XKeysymToString(keysym) == NULL)
m_keyname = std::string(); m_keyname = std::string();
else else
m_keyname = std::string(XKeysymToString(keysym)); m_keyname = std::string(XKeysymToString(keysym));