Skip to content

Commit

Permalink
Merge pull request #14 from uint32/YSF_
Browse files Browse the repository at this point in the history
Fix compilation on GCC 4.9.2
  • Loading branch information
kurta999 committed May 7, 2015
2 parents adf1ba2 + 033fb3b commit bb7b945
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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;
}
}

0 comments on commit bb7b945

Please sign in to comment.