Commit acf894d2 authored by Soar Qin's avatar Soar Qin

fixed linux compilation

parent a3cd3967
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#define myswprintf swprintf #define myswprintf swprintf
#endif #endif
#define socklen_t int
#else //_WIN32 #else //_WIN32
#include <errno.h> #include <errno.h>
...@@ -24,6 +26,7 @@ ...@@ -24,6 +26,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <unistd.h>
#define SD_BOTH 2 #define SD_BOTH 2
#define SOCKET int #define SOCKET int
......
...@@ -176,7 +176,7 @@ bool DeckManager::LoadDeck(const wchar_t* file) { ...@@ -176,7 +176,7 @@ bool DeckManager::LoadDeck(const wchar_t* file) {
FILE* fp = _wfopen(deck, L"r"); FILE* fp = _wfopen(deck, L"r");
#else #else
char deckfn[256]; char deckfn[256];
DataManager::EncodeUTF8(deck, deckfn); BufferIO::EncodeUTF8(deck, deckfn);
FILE* fp = fopen(deckfn, "r"); FILE* fp = fopen(deckfn, "r");
#endif #endif
if(!fp) if(!fp)
...@@ -213,7 +213,7 @@ void DeckManager::SaveDeck(Deck& deck, const wchar_t* name) { ...@@ -213,7 +213,7 @@ void DeckManager::SaveDeck(Deck& deck, const wchar_t* name) {
FILE* fp = _wfopen(file, L"w"); FILE* fp = _wfopen(file, L"w");
#else #else
char filefn[256]; char filefn[256];
DataManager::EncodeUTF8(file, filefn); BufferIO::EncodeUTF8(file, filefn);
FILE* fp = fopen(filefn, "w"); FILE* fp = fopen(filefn, "w");
#endif #endif
if(!fp) if(!fp)
......
...@@ -2845,7 +2845,7 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void * arg) { ...@@ -2845,7 +2845,7 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void * arg) {
mainGame->btnLanRefresh->setEnabled(true); mainGame->btnLanRefresh->setEnabled(true);
} else if(events & EV_READ) { } else if(events & EV_READ) {
sockaddr_in bc_addr; sockaddr_in bc_addr;
int sz = sizeof(sockaddr_in); socklen_t sz = sizeof(sockaddr_in);
char buf[256]; char buf[256];
int ret = recvfrom(fd, buf, 256, 0, (sockaddr*)&bc_addr, &sz); int ret = recvfrom(fd, buf, 256, 0, (sockaddr*)&bc_addr, &sz);
unsigned int ipaddr = bc_addr.sin_addr.s_addr; unsigned int ipaddr = bc_addr.sin_addr.s_addr;
......
...@@ -651,7 +651,7 @@ void Game::RefreshReplay() { ...@@ -651,7 +651,7 @@ void Game::RefreshReplay() {
continue; continue;
wchar_t wname[256]; wchar_t wname[256];
BufferIO::DecodeUTF8(dirp->d_name, wname); BufferIO::DecodeUTF8(dirp->d_name, wname);
if(lastReplay.CheckReplay(dirp->d_name)); if(Replay::CheckReplay(wname))
lstReplayList->addItem(wname); lstReplayList->addItem(wname);
} }
#endif #endif
......
...@@ -78,7 +78,7 @@ void NetServer::StopListen() { ...@@ -78,7 +78,7 @@ void NetServer::StopListen() {
} }
void NetServer::BroadcastEvent(evutil_socket_t fd, short events, void* arg) { void NetServer::BroadcastEvent(evutil_socket_t fd, short events, void* arg) {
sockaddr_in bc_addr; sockaddr_in bc_addr;
int sz = sizeof(sockaddr_in); socklen_t sz = sizeof(sockaddr_in);
char buf[256]; char buf[256];
int ret = recvfrom(fd, buf, 256, 0, (sockaddr*)&bc_addr, &sz); int ret = recvfrom(fd, buf, 256, 0, (sockaddr*)&bc_addr, &sz);
if(ret == -1) if(ret == -1)
......
...@@ -6,13 +6,15 @@ project "gframe" ...@@ -6,13 +6,15 @@ project "gframe"
files { "**.cpp", "**.cc", "**.c", "**.h" } files { "**.cpp", "**.cc", "**.c", "**.h" }
excludes "lzma/**" excludes "lzma/**"
includedirs { "../ocgcore" } includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "irrlicht", "freetype", "sqlite3", "lua" , "event"} links { "ocgcore", "clzma", "Irrlicht", "freetype", "sqlite3", "lua" , "event"}
configuration "windows" configuration "windows"
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" } links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
configuration {"windows", "not vs*"} configuration {"windows", "not vs*"}
includedirs { "/mingw/include/irrlicht", "/mingw/include/freetype2" } includedirs { "/mingw/include/irrlicht", "/mingw/include/freetype2" }
configuration "not vs*" configuration "not vs*"
buildoptions { "-std=gnu++0x" } buildoptions { "-std=gnu++0x", "-fno-rtti" }
configuration "not windows" configuration "not windows"
links { "gl", "dl" } includedirs { "/usr/include/lua", "/usr/include/lua5.2", "/usr/include/lua/5.2", "/usr/include/irrlicht", "/usr/include/freetype2" }
excludes { "COSOperator.*" }
links { "event_pthreads", "GL", "dl", "pthread" }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "config.h" #include "config.h"
#include "network.h" #include "network.h"
#include "Replay.h" #include "replay.h"
namespace ygo { namespace ygo {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "config.h" #include "config.h"
#include "network.h" #include "network.h"
#include "Replay.h" #include "replay.h"
namespace ygo { namespace ygo {
......
#[2012.3.1][2011.9.1] #[2012.3.1][2011.9.1]
!2012.3.1 !2012.3.1
#forbidden #forbidden
20663556 0 --イレカエル 20663556 0 --イレカエル
......
...@@ -14,9 +14,9 @@ extern "C" { ...@@ -14,9 +14,9 @@ extern "C" {
#include <lua/lauxlib.h> #include <lua/lauxlib.h>
#include <lua/lualib.h> #include <lua/lualib.h>
#else #else
#include <lua5.1/lua.h> #include <lua.h>
#include <lua5.1/lauxlib.h> #include <lauxlib.h>
#include <lua5.1/lualib.h> #include <lualib.h>
#endif #endif
} }
#include "common.h" #include "common.h"
......
...@@ -4,3 +4,5 @@ project "ocgcore" ...@@ -4,3 +4,5 @@ project "ocgcore"
files { "**.cc", "**.cpp", "**.c", "**.h" } files { "**.cc", "**.cpp", "**.c", "**.h" }
configuration "not vs*" configuration "not vs*"
buildoptions { "-std=gnu++0x" } buildoptions { "-std=gnu++0x" }
configuration "not windows"
includedirs { "/usr/include/lua", "/usr/include/lua5.2", "/usr/include/lua/5.2" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment