mirror of https://github.com/OpenTTD/OpenTTD
(svn r7931) -Fix (r7759): multiple (different) -O flags made compilations with the wrong optimisations.
parent
a05ab3028a
commit
8d41fe225e
|
@ -97,7 +97,7 @@ run: all
|
||||||
|
|
||||||
%.o:
|
%.o:
|
||||||
@for dir in $(SRC_DIRS); do \
|
@for dir in $(SRC_DIRS); do \
|
||||||
$(MAKE) -C $$dir $@; \
|
$(MAKE) -C $$dir $(@:src/%=%); \
|
||||||
done
|
done
|
||||||
|
|
||||||
%.lng:
|
%.lng:
|
||||||
|
|
49
config.lib
49
config.lib
|
@ -620,25 +620,10 @@ make_cflags_and_ldflags() {
|
||||||
# LDFLAGS used for HOST
|
# LDFLAGS used for HOST
|
||||||
LDFLAGS="$LDFLAGS"
|
LDFLAGS="$LDFLAGS"
|
||||||
|
|
||||||
# Each debug level reduces the optimalization by a bit
|
|
||||||
if [ $enable_debug -ge 1 ]
|
|
||||||
then
|
|
||||||
CFLAGS="$CFLAGS -g -D_DEBUG"
|
|
||||||
OBJS_SUBDIR="debug"
|
|
||||||
else
|
|
||||||
OBJS_SUBDIR="release"
|
|
||||||
fi
|
|
||||||
if [ $enable_debug -ge 2 ]
|
|
||||||
then
|
|
||||||
CFLAGS="$CFLAGS -fno-inline"
|
|
||||||
fi
|
|
||||||
if [ $enable_debug -ge 3 ]
|
|
||||||
then
|
|
||||||
CFLAGS="$CFLAGS -O0"
|
|
||||||
fi
|
|
||||||
if [ $enable_debug = 0 ]
|
if [ $enable_debug = 0 ]
|
||||||
then
|
then
|
||||||
# No debug, add default stuff
|
# No debug, add default stuff
|
||||||
|
OBJS_SUBDIR="release"
|
||||||
if [ "$os" = "OSX" ]
|
if [ "$os" = "OSX" ]
|
||||||
then
|
then
|
||||||
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer
|
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer
|
||||||
|
@ -652,18 +637,30 @@ make_cflags_and_ldflags() {
|
||||||
|
|
||||||
CFLAGS="$CFLAGS -O2 -fomit-frame-pointer"
|
CFLAGS="$CFLAGS -O2 -fomit-frame-pointer"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$enable_profiling" != "0" ]
|
|
||||||
then
|
|
||||||
CFLAGS="$CFLAGS -pg"
|
|
||||||
LDFLAGS="$LDFLAGS -pg"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if [ "$enable_profiling" != "0" ]
|
OBJS_SUBDIR="debug"
|
||||||
|
|
||||||
|
# Each debug level reduces the optimalization by a bit
|
||||||
|
if [ $enable_debug -ge 1 ]
|
||||||
then
|
then
|
||||||
CFLAGS="$CFLAGS -p"
|
CFLAGS="$CFLAGS -g -D_DEBUG"
|
||||||
LDFLAGS="$LDFLAGS -pg"
|
|
||||||
fi
|
fi
|
||||||
|
if [ $enable_debug -ge 2 ]
|
||||||
|
then
|
||||||
|
CFLAGS="$CFLAGS -fno-inline"
|
||||||
|
fi
|
||||||
|
if [ $enable_debug -ge 3 ]
|
||||||
|
then
|
||||||
|
CFLAGS="$CFLAGS -O0"
|
||||||
|
else
|
||||||
|
CFLAGS="$CFLAGS -O2"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$enable_profiling" != "0" ]
|
||||||
|
then
|
||||||
|
CFLAGS="$CFLAGS -p"
|
||||||
|
LDFLAGS="$LDFLAGS -pg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable some things only for certain GCC versions
|
# Enable some things only for certain GCC versions
|
||||||
|
@ -671,7 +668,7 @@ make_cflags_and_ldflags() {
|
||||||
|
|
||||||
if [ $cc_version -ge 29 ]
|
if [ $cc_version -ge 29 ]
|
||||||
then
|
then
|
||||||
CFLAGS="$CFLAGS -O -Wall -Wno-multichar -Wsign-compare -Wundef"
|
CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
|
||||||
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
|
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
|
||||||
|
|
||||||
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
|
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
|
|
||||||
/** DNS hostname of the masterserver */
|
/** DNS hostname of the masterserver */
|
||||||
#define NETWORK_MASTER_SERVER_HOST "master.openttd.org"
|
#define NETWORK_MASTER_SERVER_HOST "localhost"
|
||||||
/** Message sent to the masterserver to 'identify' this client as OpenTTD */
|
/** Message sent to the masterserver to 'identify' this client as OpenTTD */
|
||||||
#define NETWORK_MASTER_SERVER_WELCOME_MESSAGE "OpenTTDRegister"
|
#define NETWORK_MASTER_SERVER_WELCOME_MESSAGE "OpenTTDRegister"
|
||||||
|
|
||||||
|
|
|
@ -116,11 +116,19 @@ void NetworkUDPReceive(const SOCKET udp)
|
||||||
/* Try to receive anything */
|
/* Try to receive anything */
|
||||||
nbytes = recvfrom(udp, p.buffer, packet_len, 0, (struct sockaddr *)&client_addr, &client_len);
|
nbytes = recvfrom(udp, p.buffer, packet_len, 0, (struct sockaddr *)&client_addr, &client_len);
|
||||||
|
|
||||||
/* We got some bytes for the base header of the packet.
|
/* We got some bytes for the base header of the packet. */
|
||||||
* Assume we received the whole packet. */
|
|
||||||
if (nbytes > 2) {
|
if (nbytes > 2) {
|
||||||
NetworkRecv_ReadPacketSize(&p);
|
NetworkRecv_ReadPacketSize(&p);
|
||||||
|
|
||||||
|
/* If the size does not match the packet must be corrupted.
|
||||||
|
* Otherwise it will be marked as corrupted later on. */
|
||||||
|
if (nbytes != p.size) {
|
||||||
|
DEBUG(net, 1, "received a packet with mismatching size from %s:%d",
|
||||||
|
inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Put the position on the right place */
|
/* Put the position on the right place */
|
||||||
p.pos = 2;
|
p.pos = 2;
|
||||||
p.next = NULL;
|
p.next = NULL;
|
||||||
|
|
|
@ -53,7 +53,7 @@ DEF_UDP_RECEIVE_COMMAND(PACKET_UDP_CLIENT_FIND_SERVER)
|
||||||
NetworkSend_NetworkGameInfo(packet, &_network_game_info);
|
NetworkSend_NetworkGameInfo(packet, &_network_game_info);
|
||||||
|
|
||||||
// Let the client know that we are here
|
// Let the client know that we are here
|
||||||
NetworkSendUDP_Packet(_udp_server_socket, packet, client_addr);
|
// NetworkSendUDP_Packet(_udp_server_socket, packet, client_addr);
|
||||||
|
|
||||||
free(packet);
|
free(packet);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue