diff --git a/brush_ops.c b/brush_ops.c index 12646213..18bbbc8b 100644 --- a/brush_ops.c +++ b/brush_ops.c @@ -25,6 +25,7 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include #include "brush.h" #include "buttons.h" diff --git a/buttons.c b/buttons.c index 173dc301..b377eeea 100644 --- a/buttons.c +++ b/buttons.c @@ -19,9 +19,12 @@ You should have received a copy of the GNU General Public License along with Grafx2; if not, see */ +#define _XOPEN_SOURCE 500 + #include #include #include +#include #include #include #include diff --git a/buttons_effects.c b/buttons_effects.c index f3acedb5..eb62b93d 100644 --- a/buttons_effects.c +++ b/buttons_effects.c @@ -26,6 +26,8 @@ //////////////////////////////////////////////////////////////////////////// #include +#include +#include #include "buttons.h" #include "engine.h" diff --git a/fileformats.c b/fileformats.c index 1ae2eec2..ad455c24 100644 --- a/fileformats.c +++ b/fileformats.c @@ -29,6 +29,8 @@ #include #endif +#include + #include "errors.h" #include "global.h" #include "loadsave.h" diff --git a/filesel.c b/filesel.c index 7827531e..1c8c77be 100644 --- a/filesel.c +++ b/filesel.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/init.c b/init.c index 2d0baa00..ad603b6f 100644 --- a/init.c +++ b/init.c @@ -22,6 +22,8 @@ along with Grafx2; if not, see */ +#define _XOPEN_SOURCE 500 + // Signal handler: I activate it for the two platforms who certainly // support them. Feel free to check with others. #if defined(__WIN32__) || defined(__linux__) diff --git a/io.c b/io.c index a6d84865..cbc8d897 100644 --- a/io.c +++ b/io.c @@ -23,6 +23,8 @@ // Fonctions de lecture/ecriture file, gèrent les systèmes big-endian et // little-endian. +#define _XOPEN_SOURCE 500 + #include #include #include @@ -316,7 +318,7 @@ byte Create_lock_file(const char *file_directory) { return -1; } - #elseif !defined(__GP2X__) // gp2x does not defines F_TLOCK and is not really multitasking anyway + #else // Unixy method for lock file Lock_file_handle = open(lock_filename,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR); if (Lock_file_handle == -1) diff --git a/loadsave.c b/loadsave.c index 8b4e6df3..5740e8b7 100644 --- a/loadsave.c +++ b/loadsave.c @@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License along with Grafx2; if not, see */ -#define _XOPEN_SOURCE +#define _XOPEN_SOURCE 500 #include #include diff --git a/miscfileformats.c b/miscfileformats.c index 4a2df364..4e9fc41d 100644 --- a/miscfileformats.c +++ b/miscfileformats.c @@ -25,6 +25,9 @@ ///@file miscfileformats.c /// Formats that aren't fully saving, either because of palette restrictions or other things +#include +#include + #include "engine.h" #include "errors.h" #include "global.h" diff --git a/mountlist.c b/mountlist.c index c12b1b22..0dc4f922 100644 --- a/mountlist.c +++ b/mountlist.c @@ -36,6 +36,8 @@ #else #define MOUNTED_GETMNTENT1 #endif + +#define _XOPEN_SOURCE 500 // --- END GRAFX2 CUSTOM CONFIG --- #include "mountlist.h" @@ -332,8 +334,14 @@ fstype_to_string (int t) /* Return the device number from MOUNT_OPTIONS, if possible. Otherwise return (dev_t) -1. */ +#ifdef __linux__ + #define BROKEN __attribute__((unused)) +#else + #define BROKEN +#endif + static dev_t -dev_from_mount_options (char const *mount_options) +dev_from_mount_options (BROKEN char const *mount_options) { /* GNU/Linux allows file system implementations to define their own meaning for "dev=" mount options, so don't trust the meaning @@ -370,7 +378,7 @@ dev_from_mount_options (char const *mount_options) the returned list are valid. Otherwise, they might not be. */ struct mount_entry * -read_file_system_list (bool need_fs_type) +read_file_system_list (BROKEN bool need_fs_type) { struct mount_entry *mount_list; struct mount_entry *me; diff --git a/readini.c b/readini.c index 5516d208..d81829bd 100644 --- a/readini.c +++ b/readini.c @@ -20,6 +20,8 @@ You should have received a copy of the GNU General Public License along with Grafx2; if not, see */ +#define _XOPEN_SOURCE 500 + #include #include #include diff --git a/realpath.c b/realpath.c index ca583a15..30a4af9c 100644 --- a/realpath.c +++ b/realpath.c @@ -1,6 +1,6 @@ /* vim:expandtab:ts=2 sw=2: */ -#include +#define _XOPEN_SOURCE 500 #include #include #include diff --git a/struct.h b/struct.h index 327eb7bd..5812de6e 100644 --- a/struct.h +++ b/struct.h @@ -350,7 +350,8 @@ typedef struct T_Page byte Background_transparent; ///< Boolean, true if Layer 0 should have transparent pixels byte Transparent_color; ///< Index of transparent color. 0 to 255. byte Nb_layers; ///< Number of layers - byte * Image[0]; ///< Pixel data for the (first layer of) image. + byte * Image[]; ///< Pixel data for the (first layer of) image. + // Define as Image[0] if you have an old gcc which is not C99. // No field after Image[] ! Dynamic layer allocation for Image[1], [2] etc. } T_Page; diff --git a/text.c b/text.c index eb4598f1..1a6ce573 100644 --- a/text.c +++ b/text.c @@ -515,11 +515,16 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh return new_brush; } +#ifdef NOTTF + #define TTFONLY __attribute__((unused)) +#else + #define TTFONLY +#endif // Crée une brosse à partir des paramètres de texte demandés. // Si cela réussit, la fonction place les dimensions dans width et height, // et retourne l'adresse du bloc d'octets. -byte *Render_text(const char *str, int font_number, int size, int antialias, int bold, int italic, int *width, int *height) +byte *Render_text(const char *str, int font_number, TTFONLY int size, int TTFONLY antialias, TTFONLY int bold, TTFONLY int italic, int *width, int *height) { T_Font *font = font_list_start; int index=font_number;