mirror of https://github.com/OpenTTD/OpenTTD
(svn r16492) -Remove: support for gcc2. It hasn't been able to compile OTTD for months. All attempts to do another workaround failed.
parent
bab70a823d
commit
c03ce4b1c7
|
@ -29,7 +29,6 @@ CFLAGS_MAKEDEP= !!CFLAGS_MAKEDEP!!
|
|||
SORT = !!SORT!!
|
||||
REVISION = !!REVISION!!
|
||||
AWK = !!AWK!!
|
||||
GCC295 = !!GCC295!!
|
||||
CONFIG_CACHE_COMPILER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_COMPILER!!
|
||||
CONFIG_CACHE_LINKER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_LINKER!!
|
||||
CONFIG_CACHE_ENDIAN = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_ENDIAN!!
|
||||
|
@ -54,20 +53,6 @@ CFLAGS_MAKEDEP += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR) -I $(SCRIPT_SRC_DIR)
|
|||
|
||||
ENDIAN_TARGETS := endian_target.h $(ENDIAN_CHECK)
|
||||
|
||||
# This 'sed' basicly just removes 'const' from the line if it is a 2+D array
|
||||
# For more information, please check:
|
||||
# http://maillist.openttd.org/pipermail/devs/2007-April/000284.html
|
||||
# http://maillist.openttd.org/pipermail/devs/2007-February/000248.html
|
||||
GCC295_FIX=sed -r 's@^(\t*)(.*)( const )([A-Za-z0-9_ ]+(\[.*\]){2,})(( = \{)|(;))(.*)$$@\1\2 \4\6\8\9@g'
|
||||
# This 'sed' removes the 3rd '4' in the # lines of the -E output of
|
||||
# gcc 2.95.3 and lower, as it should indicate that it is a C-linkage, but the
|
||||
# compiler can't handle that information (just don't ask). So we remove it
|
||||
# and then it compiles happily and without bitching :)
|
||||
# Furthermore gcc 2.95 has some trouble with protected and private when
|
||||
# accessing the protected/private stuff of the enclosing class (or the
|
||||
# super class of the enclosing class).
|
||||
GCC295_FIX_2=sed -e 's@\(^\# [0-9][0-9]* "[^"]*"[ 0-9]*\) 4$$@\1@g;s@private:@public:@g;s@protected:@public:@g'
|
||||
|
||||
# Check if we want to show what we are doing
|
||||
ifdef VERBOSE
|
||||
Q =
|
||||
|
@ -240,11 +225,7 @@ $(OBJS_C): %.o: $(SRC_DIR)/%.c $(DEP_MASK) $(FILE_DEP)
|
|||
|
||||
$(OBJS_CPP): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
ifeq ($(GCC295), 1)
|
||||
$(Q)$(CXX_HOST) -E $(CFLAGS) $< | $(GCC295_FIX) | $(GCC295_FIX_2) | $(CXX_HOST) $(CFLAGS) -c -o $@ -x c++ -
|
||||
else
|
||||
$(Q)$(CXX_HOST) $(CFLAGS) -c -o $@ $<
|
||||
endif
|
||||
|
||||
$(OBJS_MM): %.o: $(SRC_DIR)/%.mm $(DEP_MASK) $(FILE_DEP)
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.mm=%.mm)'
|
||||
|
|
36
config.lib
36
config.lib
|
@ -1100,34 +1100,23 @@ make_cflags_and_ldflags() {
|
|||
# Enable some things only for certain GCC versions
|
||||
cc_version=`$cc_host -dumpversion | cut -c 1,3`
|
||||
|
||||
if [ $cc_version -ge 29 ]; then
|
||||
CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
|
||||
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
|
||||
CFLAGS="$CFLAGS -Wno-uninitialized"
|
||||
|
||||
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
|
||||
if [ $cc_version -lt 30 ]; then
|
||||
log 1 "configure: error: gcc older than 3.0 can't compile OpenTTD because of its poor template support"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gcc295=""
|
||||
if [ "$cc_version" = 29 ]; then
|
||||
# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
|
||||
# need a lovely hack there to make it compile correctly.
|
||||
gcc295="1"
|
||||
CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
|
||||
CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
|
||||
CFLAGS="$CFLAGS -Wno-uninitialized"
|
||||
|
||||
# Disable warnings about unused variables when
|
||||
# compiling with asserts disabled
|
||||
if [ $enable_assert -eq 0 ]; then
|
||||
CFLAGS="$CFLAGS -Wno-unused"
|
||||
fi
|
||||
fi
|
||||
CFLAGS="$CFLAGS -W -Wno-unused-parameter -Wformat=2"
|
||||
CFLAGS="$CFLAGS -Wredundant-decls"
|
||||
|
||||
if [ $cc_version -ge 30 ]; then
|
||||
CFLAGS="$CFLAGS -W -Wno-unused-parameter -Wformat=2"
|
||||
CFLAGS="$CFLAGS -Wredundant-decls"
|
||||
CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
|
||||
|
||||
if [ $enable_assert -eq 0 ]; then
|
||||
# Do not warn about unused variables when building without asserts
|
||||
if [ $enable_assert -eq 0 ]; then
|
||||
CFLAGS="$CFLAGS -Wno-unused-variable"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -Wno-unused-variable"
|
||||
fi
|
||||
|
||||
if [ $cc_version -ge 34 ]; then
|
||||
|
@ -2666,7 +2655,6 @@ make_sed() {
|
|||
s@!!CONFIGURE_FILES!!@$CONFIGURE_FILES@g;
|
||||
s@!!REVISION!!@$revision@g;
|
||||
s@!!AWK!!@$awk@g;
|
||||
s@!!GCC295!!@$gcc295@g;
|
||||
s@!!DISTCC!!@$distcc@g;
|
||||
"
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class Blitter_32bppOptimized : public Blitter_32bppSimple {
|
|||
public:
|
||||
struct SpriteData {
|
||||
uint32 offset[ZOOM_LVL_COUNT][2];
|
||||
byte data[VARARRAY_SIZE];
|
||||
byte data[];
|
||||
};
|
||||
|
||||
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
|
|
|
@ -12,7 +12,7 @@ class Blitter_8bppOptimized : public Blitter_8bppBase {
|
|||
public:
|
||||
struct SpriteData {
|
||||
uint32 offset[ZOOM_LVL_COUNT]; ///< offsets (from .data) to streams for different zoom levels
|
||||
byte data[VARARRAY_SIZE]; ///< data, all zoomlevels
|
||||
byte data[]; ///< data, all zoomlevels
|
||||
};
|
||||
|
||||
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
|
||||
|
|
12
src/debug.h
12
src/debug.h
|
@ -20,17 +20,9 @@
|
|||
*/
|
||||
|
||||
#ifdef NO_DEBUG_MESSAGES
|
||||
#if defined(__GNUC__) && (__GNUC__ < 3)
|
||||
#define DEBUG(name, level, args...) { }
|
||||
#else
|
||||
#define DEBUG(name, level, ...) { }
|
||||
#endif
|
||||
#define DEBUG(name, level, ...) { }
|
||||
#else /* NO_DEBUG_MESSAGES */
|
||||
#if defined(__GNUC__) && (__GNUC__ < 3)
|
||||
#define DEBUG(name, level, args...) if ((level == 0) || ( _debug_ ## name ## _level >= level)) debug(#name, args)
|
||||
#else
|
||||
#define DEBUG(name, level, ...) if (level == 0 || _debug_ ## name ## _level >= level) debug(#name, __VA_ARGS__)
|
||||
#endif
|
||||
#define DEBUG(name, level, ...) if (level == 0 || _debug_ ## name ## _level >= level) debug(#name, __VA_ARGS__)
|
||||
|
||||
extern int _debug_ai_level;
|
||||
extern int _debug_driver_level;
|
||||
|
|
|
@ -591,7 +591,7 @@ void GamelogGRFAddList(const GRFConfig *newg)
|
|||
/** List of GRFs using array of pointers instead of linked list */
|
||||
struct GRFList {
|
||||
uint n;
|
||||
const GRFConfig *grf[VARARRAY_SIZE];
|
||||
const GRFConfig *grf[];
|
||||
};
|
||||
|
||||
/** Generates GRFList
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
public:
|
||||
GRFText *next;
|
||||
byte langid;
|
||||
char text[VARARRAY_SIZE];
|
||||
char text[];
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -5,14 +5,6 @@
|
|||
#ifndef SQUIRREL_CLASS_HPP
|
||||
#define SQUIRREL_CLASS_HPP
|
||||
|
||||
#if (__GNUC__ == 2)
|
||||
/* GCC 2.95 doesn't like to have SQConvert::DefSQStaticCallback inside a
|
||||
* template (it gives an internal error 373). Above that, it doesn't listen
|
||||
* to 'using namespace' inside a function of a template. So for GCC 2.95 we
|
||||
* do it in the global space to avoid compiler errors. */
|
||||
using namespace SQConvert;
|
||||
#endif /* __GNUC__ == 2 */
|
||||
|
||||
/**
|
||||
* The template to define classes in Squirrel. It takes care of the creation
|
||||
* and calling of such classes, to make the AI Layer cleaner while having a
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
struct Array {
|
||||
int32 size;
|
||||
int32 array[VARARRAY_SIZE];
|
||||
int32 array[];
|
||||
};
|
||||
|
||||
#endif /* SQUIRREL_HELPER_TYPE_HPP */
|
||||
|
|
|
@ -19,8 +19,7 @@ enum {
|
|||
SIG_GLOB_UPDATE = 64, ///< how many items need to be in _globset to force update
|
||||
};
|
||||
|
||||
/* need to typecast to compile with MorphOS */
|
||||
assert_compile((int)SIG_GLOB_UPDATE <= (int)SIG_GLOB_SIZE);
|
||||
assert_compile(SIG_GLOB_UPDATE <= SIG_GLOB_SIZE);
|
||||
|
||||
/** incidating trackbits with given enterdir */
|
||||
static const TrackBitsByte _enterdir_to_trackbits[DIAGDIR_END] = {
|
||||
|
|
|
@ -67,7 +67,7 @@ static SpriteCache *AllocateSpriteCache(uint index)
|
|||
|
||||
struct MemBlock {
|
||||
size_t size;
|
||||
byte data[VARARRAY_SIZE];
|
||||
byte data[];
|
||||
};
|
||||
|
||||
static uint _sprite_lru_counter;
|
||||
|
|
|
@ -12,7 +12,7 @@ struct Sprite {
|
|||
uint16 width;
|
||||
int16 x_offs;
|
||||
int16 y_offs;
|
||||
byte data[VARARRAY_SIZE];
|
||||
byte data[];
|
||||
};
|
||||
|
||||
extern uint _sprite_cache_size;
|
||||
|
|
|
@ -116,9 +116,6 @@
|
|||
#define printf pspDebugScreenPrintf
|
||||
#endif /* PSP */
|
||||
|
||||
/* by default we use [] var arrays */
|
||||
#define VARARRAY_SIZE
|
||||
|
||||
/* Stuff for GCC */
|
||||
#if defined(__GNUC__)
|
||||
#define NORETURN __attribute__ ((noreturn))
|
||||
|
@ -129,11 +126,6 @@
|
|||
/* Warn about functions using 'printf' format syntax. First argument determines which parameter
|
||||
* is the format string, second argument is start of values passed to printf. */
|
||||
#define WARN_FORMAT(string, args) __attribute__ ((format (printf, string, args)))
|
||||
|
||||
#if (__GNUC__ == 2)
|
||||
#undef VARARRAY_SIZE
|
||||
#define VARARRAY_SIZE 0
|
||||
#endif
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#if defined(__WATCOMC__)
|
||||
|
|
|
@ -45,7 +45,7 @@ static char *GetSpecialNameString(char *buff, int ind, int64 *argv, const char *
|
|||
static char *FormatString(char *buff, const char *str, int64 *argv, uint casei, const char *last);
|
||||
|
||||
struct LanguagePack : public LanguagePackHeader {
|
||||
char data[VARARRAY_SIZE]; // list of strings
|
||||
char data[]; // list of strings
|
||||
};
|
||||
|
||||
static char **_langpack_offs;
|
||||
|
|
|
@ -1450,7 +1450,7 @@ enum SpriteMasks {
|
|||
|
||||
assert_compile( (1 << TRANSPARENT_BIT & SPRITE_MASK) == 0 );
|
||||
assert_compile( (1 << RECOLOUR_BIT & SPRITE_MASK) == 0 );
|
||||
assert_compile( !(TRANSPARENT_BIT == RECOLOUR_BIT) );
|
||||
assert_compile( TRANSPARENT_BIT != RECOLOUR_BIT );
|
||||
assert_compile( (1 << TRANSPARENT_BIT & PALETTE_MASK) == 0);
|
||||
assert_compile( (1 << RECOLOUR_BIT & PALETTE_MASK) == 0 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue