Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation on GCC 4.9.2 #14

Merged
1 commit merged into from
May 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# make YSF
#

GPP = g++ -m32 -Ilib -DSAMPGDK_AMALGAMATION -nodefaultlibs
GCC = gcc -m32 -Ilib -DSAMPGDK_AMALGAMATION -nodefaultlibs
GPP = g++ -m32 -Ilib -DSAMPGDK_AMALGAMATION -fno-stack-protector
GCC = gcc -m32 -Ilib -DSAMPGDK_AMALGAMATION -fno-stack-protector
YSF_OUTFILE = "./YSF.so"

COMPILE_FLAGS = -c -O3 -fpack-struct=1 -fPIC -w -DLINUX
Expand All @@ -24,4 +24,4 @@ YSF: clean
$(GCC) $(YSF) ./lib/subhook/subhook.c
$(GCC) $(YSF) ./lib/sampgdk/sampgdk.c
$(GPP) $(YSF) ./src/*.cpp
$(GCC) -fshort-wchar -shared -o $(YSF_OUTFILE) *.o
$(GCC) -nodefaultlibs -fshort-wchar -shared -o $(YSF_OUTFILE) *.o
6 changes: 3 additions & 3 deletions src/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,14 @@ static BYTE HOOK_GetPacketID(Packet *p)
#ifdef _WIN32
bool __thiscall CHookRakServer::Send(void* ppRakServer, RakNet::BitStream* parameters, PacketPriority priority, PacketReliability reliability, unsigned orderingChannel, PlayerID playerId, bool broadcast)
#else
bool CHookRakServer::Send(void* ppRakServer, RakNet::BitStream* parameters, int priority, int reliability, unsigned orderingChannel, PlayerID playerId, bool broadcast)
bool CHookRakServer::Send(void* ppRakServer, RakNet::BitStream* parameters, PacketPriority priority, PacketReliability reliability, unsigned orderingChannel, PlayerID playerId, bool broadcast)
#endif
{
/*
BYTE id;
WORD playerid;
parameters->Read(id);
parameters->Read(playerid);
parameters->Read(playerid);

logprintf("id: %d - playerid: %d, sendto. %d", id, playerid, pRakServer->GetIndexFromPlayerID(playerId));
*/
Expand Down Expand Up @@ -897,4 +897,4 @@ void InstallPostHooks()
RakNetOriginalRPC = reinterpret_cast<RakNet__RPC_t>(RPCFunc);
Unlock((void*)&((int*)(*(void**)pRakServer))[RAKNET_RPC_OFFSET], 4);
((int*)(*(void**)pRakServer))[RAKNET_RPC_OFFSET] = (int)CHookRakServer::RPC;
}
}