* Add network primitives by Freddie Witherden <EvilGuru>
* Modify them slighly to use get/set functions for the package direction (instead of a global accessable to all files which forward declare it) * Add a NETfloat to the set of primitives * Modify NETstring to use strnlen1 instead of strnlen which is a GNU extension to the C library (strnlen1 has been copied from gettext 0.16.1 which is GPLv2+) NB: rerun your buildsystems NB2: Xcode requires an update git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2358 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
4213087057
commit
74e64738fa
|
@ -11,9 +11,9 @@ CLEANFILES = resource_parser.tab.h strres_parser.tab.h
|
|||
|
||||
noinst_LIBRARIES = libframework.a
|
||||
noinst_HEADERS = configfile.h cursors.h cursors16.h debug.h fractions.h frame.h \
|
||||
frameint.h frameresource.h input.h listmacs.h resly.h \
|
||||
frameint.h frameresource.h input.h listmacs.h resly.h strnlen1.h \
|
||||
strres.h strresly.h treap.h treapint.h trig.h types.h utf8.h
|
||||
|
||||
libframework_a_SOURCES = SDL_framerate.c configfile.c debug.c exceptionhandler.c \
|
||||
frame.c frameresource.c input.c resource_lexer.lex.c resource_parser.tab.c \
|
||||
strres.c strres_lexer.lex.c strres_parser.tab.c treap.c trig.c utf8.c
|
||||
strnlen1.c strres.c strres_lexer.lex.c strres_parser.tab.c treap.c trig.c utf8.c
|
||||
|
|
|
@ -9,6 +9,7 @@ SRC=configfile.c \
|
|||
input.c \
|
||||
resource_parser.tab.c \
|
||||
resource_lexer.lex.c \
|
||||
strnlen1.c \
|
||||
strres.c \
|
||||
strres_parser.tab.c \
|
||||
strres_lexer.lex.c \
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
This file is part of Warzone 2100.
|
||||
Find the length of STRING + 1, but scan at most MAXLEN bytes.
|
||||
Copyright (C) 2005-2006 Free Software Foundation, Inc.
|
||||
|
||||
Warzone 2100 is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Warzone 2100 is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Warzone 2100; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
$Revision$
|
||||
$Id$
|
||||
$HeadURL$
|
||||
*/
|
||||
|
||||
/* Specification. */
|
||||
#include "strnlen1.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
|
||||
If no '\0' terminator is found in that many characters, return MAXLEN. */
|
||||
/* This is the same as strnlen (string, maxlen - 1) + 1. */
|
||||
size_t strnlen1(const char* string, size_t maxlen)
|
||||
{
|
||||
// Find the first NUL char
|
||||
const char* end = memchr (string, '\0', maxlen);
|
||||
|
||||
if (end != NULL)
|
||||
return end - string + 1;
|
||||
else
|
||||
return maxlen;
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
This file is part of Warzone 2100.
|
||||
Find the length of STRING + 1, but scan at most MAXLEN bytes.
|
||||
Copyright (C) 2005-2006 Free Software Foundation, Inc.
|
||||
|
||||
Warzone 2100 is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Warzone 2100 is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Warzone 2100; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
$Revision$
|
||||
$Id$
|
||||
$HeadURL$
|
||||
*/
|
||||
|
||||
#ifndef __INCLUDED_LIB_FRAMEWORK_STRNLEN1_H__
|
||||
#define __INCLUDED_LIB_FRAMEWORK_STRNLEN1_H__
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
|
||||
If no '\0' terminator is found in that many characters, return MAXLEN. */
|
||||
/* This is the same as strnlen (string, maxlen - 1) + 1. */
|
||||
extern size_t strnlen1 (const char* string, size_t maxlen);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __INCLUDED_LIB_FRAMEWORK_STRNLEN1_H__
|
|
@ -65,6 +65,12 @@ static void NETallowJoining(void);
|
|||
extern BOOL MultiPlayerJoin(UDWORD dpid); /* from src/multijoin.c ! */
|
||||
extern BOOL MultiPlayerLeave(UDWORD dpid); /* from src/multijoin.c ! */
|
||||
|
||||
/*
|
||||
* Network globals, these are part of the new network API
|
||||
*/
|
||||
NETMSG NetMsg;
|
||||
static PACKETDIR NetDir;
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////
|
||||
// Types
|
||||
|
||||
|
@ -1585,6 +1591,15 @@ BOOL NETjoinGame(UDWORD gameNumber, const char* playername)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void NETsetPacketDir(PACKETDIR dir)
|
||||
{
|
||||
NetDir = dir;
|
||||
}
|
||||
|
||||
PACKETDIR NETgetPacketDir()
|
||||
{
|
||||
return NetDir;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Set the masterserver name
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#ifndef _netplay_h
|
||||
#define _netplay_h
|
||||
|
||||
#include "nettypes.h"
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////
|
||||
// Include this file in your game to add multiplayer facilities.
|
||||
|
||||
|
@ -67,6 +69,7 @@ typedef struct {
|
|||
uint8_t type; // type of packet
|
||||
uint8_t destination; // player to send to, or NET_ALL_PLAYERS
|
||||
char body[MaxMsgSize];
|
||||
BOOL status; // If the packet compiled or not (this is _not_ sent!)
|
||||
} NETMSG;
|
||||
|
||||
#define AUDIOMSG 255 // an audio packet (special message);
|
||||
|
@ -111,6 +114,8 @@ typedef struct {
|
|||
|
||||
extern NETPLAY NetPlay;
|
||||
|
||||
extern NETMSG NetMsg;
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////
|
||||
// functions available to you.
|
||||
extern BOOL NETinit(BOOL bFirstCall); //init(guid can be NULL)
|
||||
|
@ -150,6 +155,9 @@ extern BOOL NETgetGlobalPlayerData(UDWORD dpid, void *pData, SDWORD *pSize);
|
|||
extern BOOL NETsetLocalPlayerData(UDWORD dpid, void *pData, SDWORD size);
|
||||
extern BOOL NETsetGlobalPlayerData(UDWORD dpid, void *pData, SDWORD size);
|
||||
|
||||
extern void NETsetPacketDir(PACKETDIR dir);
|
||||
extern PACKETDIR NETgetPacketDir(void);
|
||||
|
||||
#include "netlog.h"
|
||||
|
||||
extern void NETsetMasterserverName(const char* hostname);
|
||||
|
|
|
@ -16,3 +16,356 @@
|
|||
along with Warzone 2100; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/*
|
||||
* Nettypes.c
|
||||
*
|
||||
* Contains the 'new' Network API functiosn for sending and receiving both
|
||||
* low-level primitives and higher-level types.
|
||||
*/
|
||||
|
||||
#include "lib/framework/wzglobal.h"
|
||||
#include "lib/framework/strnlen1.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef WZ_OS_WIN
|
||||
# include <winsock.h>
|
||||
#else
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include "../framework/frame.h"
|
||||
#include "netplay.h"
|
||||
#include "nettypes.h"
|
||||
|
||||
/*
|
||||
* Begin & End functions
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initialises the packet and sets the type of the packet to type
|
||||
* FIXME: Use an enum for the packet type.
|
||||
*/
|
||||
void NETbegin(uint8_t type, PACKETDIR dir)
|
||||
{
|
||||
NETsetPacketDir(dir);
|
||||
NetMsg.type = type;
|
||||
NetMsg.size = 0;
|
||||
NetMsg.status = TRUE;
|
||||
|
||||
// If encoding zero the message body and size
|
||||
if (dir == PACKET_ENCODE)
|
||||
{
|
||||
memset(&NetMsg.body, '\0', MaxMsgSize);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends the packet, sending it to the player specified. If player is equal to
|
||||
* NET_ALL_PLAYERS then the packet is, as expected, sent to everyone.
|
||||
*/
|
||||
BOOL NETend(uint8_t player)
|
||||
{
|
||||
assert(NETgetPacketDir() != PACKET_INVALID);
|
||||
|
||||
// If the packet is not being sent or failed to compile
|
||||
if (NETgetPacketDir() != PACKET_ENCODE || !NetMsg.status)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// We have sent the packet, so make it invalid (to prevent re-sending)
|
||||
NETsetPacketDir(PACKET_INVALID);
|
||||
|
||||
// Send the packet, updating the send functions is on my todo list!
|
||||
if (player == NET_ALL_PLAYERS)
|
||||
{
|
||||
return NETbcast(&NetMsg, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NETsend(&NetMsg, player, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Primitive functions (ints and strings). Due to the lack of C++ and the fact
|
||||
* that I hate macros this is a lot longer than it should be.
|
||||
*/
|
||||
|
||||
BOOL NETint8_t(int8_t *ip)
|
||||
{
|
||||
int8_t *store = (int8_t *) &NetMsg.body[NetMsg.size];
|
||||
|
||||
// Make sure there is enough data/space left in the packet
|
||||
if (sizeof(int8_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
|
||||
{
|
||||
return NetMsg.status = FALSE;
|
||||
}
|
||||
|
||||
// 8-bit (1 byte) integers need no endian-swapping!
|
||||
if (NETgetPacketDir() == PACKET_ENCODE)
|
||||
{
|
||||
*store = *ip;
|
||||
}
|
||||
else if (NETgetPacketDir() == PACKET_DECODE)
|
||||
{
|
||||
*ip = *store;
|
||||
}
|
||||
|
||||
// Increment the size of the message
|
||||
NetMsg.size += sizeof(int8_t);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL NETuint8_t(uint8_t *ip)
|
||||
{
|
||||
uint8_t *store = (uint8_t *) &NetMsg.body[NetMsg.size];
|
||||
|
||||
// Make sure there is enough data/space left in the packet
|
||||
if (sizeof(uint8_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
|
||||
{
|
||||
return NetMsg.status = FALSE;
|
||||
}
|
||||
|
||||
// 8-bit (1 byte) integers need no endian-swapping!
|
||||
if (NETgetPacketDir() == PACKET_ENCODE)
|
||||
{
|
||||
*store = *ip;
|
||||
}
|
||||
else if (NETgetPacketDir() == PACKET_DECODE)
|
||||
{
|
||||
*ip = *store;
|
||||
}
|
||||
|
||||
// Increment the size of the message
|
||||
NetMsg.size += sizeof(uint8_t);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL NETint16_t(int16_t *ip)
|
||||
{
|
||||
int16_t *store = (int16_t *) &NetMsg.body[NetMsg.size];
|
||||
|
||||
// Make sure there is enough data/space left in the packet
|
||||
if (sizeof(int16_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
|
||||
{
|
||||
return NetMsg.status = FALSE;
|
||||
}
|
||||
|
||||
// Convert the integer into the network byte order (big endian)
|
||||
if (NETgetPacketDir() == PACKET_ENCODE)
|
||||
{
|
||||
*store = htons(*ip);
|
||||
}
|
||||
else if (NETgetPacketDir() == PACKET_DECODE)
|
||||
{
|
||||
*ip = ntohs(*store);
|
||||
}
|
||||
|
||||
// Increment the size of the message
|
||||
NetMsg.size += sizeof(int16_t);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL NETuint16_t(uint16_t *ip)
|
||||
{
|
||||
uint16_t *store = (uint16_t *) &NetMsg.body[NetMsg.size];
|
||||
|
||||
// Make sure there is enough data/space left in the packet
|
||||
if (sizeof(uint16_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
|
||||
{
|
||||
return NetMsg.status = FALSE;
|
||||
}
|
||||
|
||||
// Convert the integer into the network byte order (big endian)
|
||||
if (NETgetPacketDir() == PACKET_ENCODE)
|
||||
{
|
||||
*store = htons(*ip);
|
||||
}
|
||||
else if (NETgetPacketDir() == PACKET_DECODE)
|
||||
{
|
||||
*ip = ntohs(*store);
|
||||
}
|
||||
|
||||
// Increment the size of the message
|
||||
NetMsg.size += sizeof(uint16_t);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL NETint32_t(int32_t *ip)
|
||||
{
|
||||
int32_t *store = (int32_t *) &NetMsg.body[NetMsg.size];
|
||||
|
||||
// Make sure there is enough data/space left in the packet
|
||||
if (sizeof(int32_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
|
||||
{
|
||||
return NetMsg.status = FALSE;
|
||||
}
|
||||
|
||||
// Convert the integer into the network byte order (big endian)
|
||||
if (NETgetPacketDir() == PACKET_ENCODE)
|
||||
{
|
||||
*store = htonl(*ip);
|
||||
}
|
||||
else if (NETgetPacketDir() == PACKET_DECODE)
|
||||
{
|
||||
*ip = ntohl(*store);
|
||||
}
|
||||
|
||||
// Increment the size of the message
|
||||
NetMsg.size += sizeof(int32_t);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL NETuint32_t(uint32_t *ip)
|
||||
{
|
||||
uint32_t *store = (uint32_t *) &NetMsg.body[NetMsg.size];
|
||||
|
||||
// Make sure there is enough data/space left in the packet
|
||||
if (sizeof(uint32_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
|
||||
{
|
||||
return NetMsg.status = FALSE;
|
||||
}
|
||||
|
||||
// Convert the integer into the network byte order (big endian)
|
||||
if (NETgetPacketDir() == PACKET_ENCODE)
|
||||
{
|
||||
*store = htonl(*ip);
|
||||
}
|
||||
else if (NETgetPacketDir() == PACKET_DECODE)
|
||||
{
|
||||
*ip = ntohl(*store);
|
||||
}
|
||||
|
||||
// Increment the size of the message
|
||||
NetMsg.size += sizeof(uint32_t);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL NETfloat(float* fp)
|
||||
{
|
||||
/*
|
||||
* NB: Not portable.
|
||||
* This routine only works on machines with IEEE754 floating point numbers.
|
||||
*/
|
||||
|
||||
#if !defined(__STDC_IEC_559__) \
|
||||
&& !defined(__m68k__) && !defined(__sparc__) && !defined(__i386__) \
|
||||
&& !defined(__mips__) && !defined(__ns32k__) && !defined(__alpha__) \
|
||||
&& !defined(__arm__) && !defined(__ppc__) && !defined(__ia64__) \
|
||||
&& !defined(__arm26__) && !defined(__sparc64__) && !defined(__amd64__)
|
||||
# error "this platform hasn't been confirmed to support IEEE754 floating point numbers"
|
||||
#endif
|
||||
|
||||
// IEEE754 floating point numbers can be treated the same as 32bit integers
|
||||
// with regards to endian conversion
|
||||
STATIC_ASSERT(sizeof(float) == sizeof(int32_t));
|
||||
|
||||
return NETint32_t((int32_t*) fp);
|
||||
}
|
||||
|
||||
BOOL NETbool(BOOL *bp)
|
||||
{
|
||||
// Bools are converted to uint8_ts
|
||||
uint8_t tmp = (uint8_t) *bp;
|
||||
NETuint8_t(&tmp);
|
||||
|
||||
// If we are decoding and managed to extract the value set it
|
||||
if (NETgetPacketDir() == PACKET_DECODE && NetMsg.status)
|
||||
{
|
||||
*bp = (BOOL) tmp;
|
||||
}
|
||||
|
||||
return NetMsg.status;
|
||||
}
|
||||
|
||||
/*
|
||||
* NETnull should be used to either add 4 bytes of padding to a message, or to
|
||||
* discard 4 bytes of data from a message.
|
||||
*/
|
||||
BOOL NETnull ()
|
||||
{
|
||||
uint32_t zero = 0;
|
||||
return NETuint32_t(&zero);
|
||||
}
|
||||
|
||||
BOOL NETstring(char *str, uint16_t maxlen)
|
||||
{
|
||||
/*
|
||||
* Strings sent over the network are prefixed with their length, sent as an
|
||||
* unsigned 16-bit integer.
|
||||
*/
|
||||
|
||||
// Work out the length of the string if we are encoding
|
||||
uint16_t len = (NETgetPacketDir() == PACKET_ENCODE) ? strnlen1(str, maxlen) : 0;
|
||||
char *store;
|
||||
|
||||
// Add/fetch the length from the packet
|
||||
NETuint16_t(&len);
|
||||
|
||||
// Map store to the message buffer
|
||||
store = (char *) &NetMsg.body[NetMsg.size];
|
||||
|
||||
// Make sure there is enough data/space left in the packet
|
||||
if (len + NetMsg.size > MaxMsgSize || !NetMsg.status)
|
||||
{
|
||||
return NetMsg.status = FALSE;
|
||||
}
|
||||
|
||||
if (NETgetPacketDir() == PACKET_ENCODE)
|
||||
{
|
||||
memcpy(store, str, len);
|
||||
}
|
||||
else if (NETgetPacketDir() == PACKET_DECODE)
|
||||
{
|
||||
memcpy(str, store, len);
|
||||
}
|
||||
|
||||
// Increment the size of the message
|
||||
NetMsg.size += sizeof(len) + len;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void NETcoder(PACKETDIR dir)
|
||||
{
|
||||
char str[100];
|
||||
char *original = "THIS IS A TEST STRING";
|
||||
BOOL b = TRUE;
|
||||
uint32_t u32 = 32;
|
||||
uint16_t u16 = 16;
|
||||
uint8_t u8 = 8;
|
||||
int32_t i32 = -32;
|
||||
int16_t i16 = -16;
|
||||
int8_t i8 = -8;
|
||||
|
||||
strcpy(str, original);
|
||||
NETbegin(0, dir);
|
||||
NETbool(&b); assert(b == TRUE);
|
||||
NETuint32_t(&u32); assert(u32 == 32);
|
||||
NETuint16_t(&u16); assert(u16 == 16);
|
||||
NETuint8_t(&u8); assert(u8 == 8);
|
||||
NETint32_t(&i32); assert(i32 == -32);
|
||||
NETint16_t(&i16); assert(i16 == -16);
|
||||
NETint8_t(&i8); assert(i8 == -8);
|
||||
NETstring(str, 99); assert(strncmp(str, original, 99) == 0);
|
||||
NETend(0);
|
||||
}
|
||||
|
||||
void NETtest()
|
||||
{
|
||||
NETMSG cmp;
|
||||
|
||||
memset(&cmp, 0, sizeof(cmp));
|
||||
memset(&NetMsg, 0, sizeof(NetMsg));
|
||||
NETcoder(PACKET_ENCODE);
|
||||
memcpy(&cmp, &NetMsg, sizeof(cmp));
|
||||
NETcoder(PACKET_DECODE);
|
||||
ASSERT(memcmp(&cmp, &NetMsg, sizeof(cmp)) == 0, "nettypes unit test failed");
|
||||
}
|
||||
|
|
|
@ -16,9 +16,44 @@
|
|||
along with Warzone 2100; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/*
|
||||
* Nettypes.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __INCLUDE_LIB_NETPLAY_NETTYPES_H__
|
||||
#define __INCLUDE_LIB_NETPLAY_NETTYPES_H__
|
||||
|
||||
#include "netplay.h"
|
||||
|
||||
#endif //__INCLUDE_LIB_NETPLAY_NETTYPES_H__
|
||||
typedef enum packetDirectionEnum
|
||||
{
|
||||
PACKET_ENCODE,
|
||||
PACKET_DECODE,
|
||||
PACKET_INVALID
|
||||
} PACKETDIR;
|
||||
|
||||
void NETbegin(uint8_t type, PACKETDIR dir);
|
||||
BOOL NETend(uint8_t player);
|
||||
BOOL NETint8_t(int8_t *ip);
|
||||
BOOL NETuint8_t(uint8_t *ip);
|
||||
BOOL NETint16_t(int16_t *ip);
|
||||
BOOL NETuint16_t(uint16_t *ip);
|
||||
BOOL NETint32_t(int32_t *ip);
|
||||
BOOL NETuint32_t(uint32_t *ip);
|
||||
BOOL NETbool(BOOL *bp);
|
||||
BOOL NETnull(void);
|
||||
BOOL NETstring(char *str, uint16_t maxlen);
|
||||
|
||||
#define NETenum(enumPtr) \
|
||||
{ \
|
||||
int32_t _val = (NETgetPacketDir() == PACKET_ENCODE) ? *(enumPtr) : 0; \
|
||||
\
|
||||
NETint32_t(&_val); \
|
||||
\
|
||||
*(enumPtr) = _val; \
|
||||
}
|
||||
|
||||
void NETtest();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -36,24 +36,34 @@
|
|||
<Add option="-Wall" />
|
||||
<Add option="-Werror-implicit-function-declaration" />
|
||||
<Add option="-std=gnu99" />
|
||||
<Add option='-DVERSION=\\"TRUNK\\"' />
|
||||
<Add option='-DLOCALEDIR=\\"\\"' />
|
||||
<Add option='-DPACKAGE=\\"warzone2100\\"' />
|
||||
<Add option='-DVERSION=\"TRUNK-r2026\"' />
|
||||
<Add option='-DLOCALEDIR=\"\"' />
|
||||
<Add option='-DPACKAGE=\"warzone2100\"' />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DYY_STATIC" />
|
||||
<Add directory="." />
|
||||
<Add directory="C:\devpkg\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="mingw32" />
|
||||
<Add library="SDLmain" />
|
||||
<Add library="physfs" />
|
||||
<Add library="png" />
|
||||
<Add library="m" />
|
||||
<Add library="z" />
|
||||
<Add library="SDL" />
|
||||
<Add library="pthread" />
|
||||
<Add library="gdi32" />
|
||||
<Add library="SDL_net" />
|
||||
<Add library="GL" />
|
||||
<Add library="GLU" />
|
||||
<Add library="openal" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
<Add library="openal32" />
|
||||
<Add library="vorbisfile" />
|
||||
<Add library="vorbis" />
|
||||
<Add library="ogg" />
|
||||
<Add library="dbghelp" />
|
||||
<Add library="winmm" />
|
||||
<Add library="wsock32" />
|
||||
<Add library="glc32" />
|
||||
<Add directory="C:\devpkg\lib" />
|
||||
</Linker>
|
||||
<Unit filename="lib/framework/SDL_framerate.c">
|
||||
<Option compilerVar="CC" />
|
||||
|
@ -106,6 +116,10 @@
|
|||
<Option weight="10" />
|
||||
<Option compiler="gcc" use="1" buildCommand="bison -y -d -olib/framework/resource_parser.tab.c $file\n$compiler $options $includes -c lib/framework/resource_parser.tab.c -o $object" />
|
||||
</Unit>
|
||||
<Unit filename="lib/framework/strnlen1.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="lib/framework/strnlen1.h" />
|
||||
<Unit filename="lib/framework/strres.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
|
@ -866,6 +880,9 @@
|
|||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="src/wrappers.h" />
|
||||
<Unit filename="win32\warzone2100.rc">
|
||||
<Option compilerVar="WINDRES" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
|
|
|
@ -239,6 +239,10 @@
|
|||
RelativePath="..\lib\framework\SDL_framerate.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\framework\strnlen1.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\framework\strres.c"
|
||||
>
|
||||
|
@ -1280,6 +1284,10 @@
|
|||
RelativePath="..\lib\framework\frameresource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\framework\strnlen1.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\framework\utf8.h"
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue