summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-06-17 09:53:22 +0000
committermatthijs <matthijs@openttd.org>2005-06-17 09:53:22 +0000
commit3c133f1f539622f622700e1c704e0d84718cc1b5 (patch)
treec6326d41f187e825a5275a8259dd965641b988f6
parent8c6fa13faacda3a5bb154af747aa4008d3f1d867 (diff)
downloadopenttd-3c133f1f539622f622700e1c704e0d84718cc1b5.tar.xz
(svn r2453) * CodeChange: Declared the lookup arrays in rail.h as extern, so the linker will complain if they are not defined (ie when rail.c is not included).
-rw-r--r--rail.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/rail.h b/rail.h
index 61c81831b..47fd33f84 100644
--- a/rail.h
+++ b/rail.h
@@ -153,21 +153,21 @@ static inline bool IsValidTrackdir(Trackdir trackdir) { return trackdir < TRACKD
* Maps a trackdir to the bit that stores its status in the map arrays, in the
* direction along with the trackdir.
*/
-const byte _signal_along_trackdir[TRACKDIR_END];
+extern const byte _signal_along_trackdir[TRACKDIR_END];
static inline byte SignalAlongTrackdir(Trackdir trackdir) {return _signal_along_trackdir[trackdir];}
/**
* Maps a trackdir to the bit that stores its status in the map arrays, in the
* direction against the trackdir.
*/
-const byte _signal_against_trackdir[TRACKDIR_END];
+extern const byte _signal_against_trackdir[TRACKDIR_END];
static inline byte SignalAgainstTrackdir(Trackdir trackdir) { return _signal_against_trackdir[trackdir]; }
/**
* Maps a Track to the bits that store the status of the two signals that can
* be present on the given track.
*/
-const byte _signal_on_track[TRACK_END];
+extern const byte _signal_on_track[TRACK_END];
static inline byte SignalOnTrack(Track track) { return _signal_on_track[track]; }
/*
@@ -247,7 +247,7 @@ static inline bool HasTrack(TileIndex tile, Track track)
/**
* Maps a trackdir to the reverse trackdir.
*/
-const Trackdir _reverse_trackdir[TRACKDIR_END];
+extern const Trackdir _reverse_trackdir[TRACKDIR_END];
static inline Trackdir ReverseTrackdir(Trackdir trackdir) { return _reverse_trackdir[trackdir]; }
/**
@@ -280,48 +280,48 @@ static inline TrackdirBits TrackToTrackdirBits(Track track) { Trackdir td = Trac
* ahead. This will be the same trackdir for diagonal trackdirs, but a
* different (alternating) one for straight trackdirs
*/
-const Trackdir _next_trackdir[TRACKDIR_END];
+extern const Trackdir _next_trackdir[TRACKDIR_END];
static inline Trackdir NextTrackdir(Trackdir trackdir) { return _next_trackdir[trackdir]; }
/**
* Maps a track to all tracks that make 90 deg turns with it.
*/
-const TrackBits _track_crosses_tracks[TRACK_END];
+extern const TrackBits _track_crosses_tracks[TRACK_END];
static inline TrackBits TrackCrossesTracks(Track track) { return _track_crosses_tracks[track]; }
/**
* Maps a trackdir to the (4-way) direction the tile is exited when following
* that trackdir.
*/
-const DiagDirection _trackdir_to_exitdir[TRACKDIR_END];
+extern const DiagDirection _trackdir_to_exitdir[TRACKDIR_END];
static inline DiagDirection TrackdirToExitdir(Trackdir trackdir) { return _trackdir_to_exitdir[trackdir]; }
/**
* Maps a track and an (4-way) dir to the trackdir that represents the track
* with the exit in the given direction.
*/
-const Trackdir _track_exitdir_to_trackdir[TRACK_END][DIAGDIR_END];
+extern const Trackdir _track_exitdir_to_trackdir[TRACK_END][DIAGDIR_END];
static inline Trackdir TrackExitdirToTrackdir(Track track, DiagDirection diagdir) { return _track_exitdir_to_trackdir[track][diagdir]; }
/**
* Maps a track and a full (8-way) direction to the trackdir that represents
* the track running in the given direction.
*/
-const Trackdir _track_direction_to_trackdir[TRACK_END][DIR_END];
+extern const Trackdir _track_direction_to_trackdir[TRACK_END][DIR_END];
static inline Trackdir TrackDirectionToTrackdir(Track track, Direction dir) { return _track_direction_to_trackdir[track][dir]; }
/**
* Maps a (4-way) direction to the diagonal trackdir that runs in that
* direction.
*/
-const Trackdir _dir_to_diag_trackdir[DIAGDIR_END];
+extern const Trackdir _dir_to_diag_trackdir[DIAGDIR_END];
static inline Trackdir DiagdirToDiagTrackdir(DiagDirection diagdir) { return _dir_to_diag_trackdir[diagdir]; }
/**
* Maps a trackdir to the trackdirs that can be reached from it (ie, when
* entering the next tile. This
*/
-const TrackdirBits _exitdir_reaches_trackdirs[DIAGDIR_END];
+extern const TrackdirBits _exitdir_reaches_trackdirs[DIAGDIR_END];
/* Note that there is no direct table for this function (there used to be),
* but it uses two simpeler tables to achieve the result */
static inline TrackdirBits TrackdirReachesTrackdirs(Trackdir trackdir) { return _exitdir_reaches_trackdirs[TrackdirToExitdir(trackdir)]; }
@@ -329,13 +329,13 @@ static inline TrackdirBits TrackdirReachesTrackdirs(Trackdir trackdir) { return
/**
* Maps a trackdir to all trackdirs that make 90 deg turns with it.
*/
-const TrackdirBits _track_crosses_trackdirs[TRACKDIR_END];
+extern const TrackdirBits _track_crosses_trackdirs[TRACKDIR_END];
static inline TrackdirBits TrackdirCrossesTrackdirs(Trackdir trackdir) { return _track_crosses_trackdirs[TrackdirToTrack(trackdir)]; }
/**
* Maps a (4-way) direction to the reverse.
*/
-const DiagDirection _reverse_diagdir[DIAGDIR_END];
+extern const DiagDirection _reverse_diagdir[DIAGDIR_END];
static inline DiagDirection ReverseDiagdir(DiagDirection diagdir) { return _reverse_diagdir[diagdir]; }
/* Checks if a given Track is diagonal */