Commit acf894d2 authored by Soar Qin's avatar Soar Qin

fixed linux compilation

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