Patch collection from Volker Grabsch to help Tux Paint cross-compile for Windows:
* Solve the 'FIXME: "finddir" ...' (The trick is to use "=" instead of ":=". That way, $(beos_PREFIX) will only be evaluated when it is actually used.) * include "shlwapi.h" instead of "Shlwapi.h" (Otherwise, compiling for Windows will fail on a case sensitive file system. (e.g. a Unix file system when cross compiling)) * use FILENAME_MAX instead of NAME_MAX (FILENAME_MAX is more portable than NAME_MAX. Also, recent MinGW versions don't support NAME_MAX anymore.) * Exposing font_thread_aborted via extern [tweak to Volker's patch which removed a logic test, which is probably not what we want] * include parse.h (and thus compiler.h) after <stdio.h> (This ensures that the perror() macro of compiler.h won't confuse the perror() function declaration of <stdio.h>.) * fix another compiling error about undefined variables (The tuxpaint.c uses printcommand/altprintcommand/papersize even when they aren't defined, i.e. when libpaper is not used. This patch solves the issue by using "#ifdef PAPER_H") * call show_available_papersizes() only when libpaper is used * permit cross compiling by using Make variables instead of hard-coded tools Documented scottmc's Haiku improvements.
This commit is contained in:
parent
5be63987d1
commit
7b31b7549d
8 changed files with 46 additions and 25 deletions
|
|
@ -24,7 +24,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
June 14, 2002 - February 18, 2006
|
||||
June 14, 2002 - February 24, 2010
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
WIN32 and MINGW don't have strcasestr().
|
||||
*/
|
||||
#define NOMINMAX
|
||||
#include "Shlwapi.h"
|
||||
#include "shlwapi.h"
|
||||
#define strcasestr StrStrI
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ int no_system_fonts = 1;
|
|||
#endif
|
||||
int all_locale_fonts;
|
||||
volatile long font_thread_done;
|
||||
static volatile long font_thread_aborted;
|
||||
volatile long font_thread_aborted;
|
||||
volatile long waiting_for_fonts;
|
||||
static int font_scanner_pid;
|
||||
int font_socket_fd;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
extern SDL_Thread *font_thread;
|
||||
|
||||
extern volatile long font_thread_done;
|
||||
extern volatile long font_thread_aborted;
|
||||
extern volatile long waiting_for_fonts;
|
||||
extern int font_socket_fd;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
%{
|
||||
|
||||
#include "../src/parse.h"
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stdint.h>
|
||||
#include "../src/parse.h"
|
||||
|
||||
const char PARSE_YES[] = "yes";
|
||||
const char PARSE_NO[] = "no";
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
June 14, 2002 - October 13, 2009
|
||||
June 14, 2002 - February 24, 2010
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -268,7 +268,7 @@ typedef struct safer_dirent
|
|||
ino_t d_ino;
|
||||
ino_t d_pino;
|
||||
unsigned short d_reclen;
|
||||
char d_name[NAME_MAX];
|
||||
char d_name[FILENAME_MAX];
|
||||
} safer_dirent;
|
||||
#define dirent safer_dirent
|
||||
|
||||
|
|
@ -1501,9 +1501,9 @@ static int cursor_left, cursor_x, cursor_y, cursor_textwidth; /* canvas-relative
|
|||
static int old_cursor_x, old_cursor_y;
|
||||
static int cur_label, cur_select;
|
||||
static int been_saved;
|
||||
static char file_id[NAME_MAX];
|
||||
static char starter_id[NAME_MAX];
|
||||
static char template_id[NAME_MAX];
|
||||
static char file_id[FILENAME_MAX];
|
||||
static char starter_id[FILENAME_MAX];
|
||||
static char template_id[FILENAME_MAX];
|
||||
static int brush_scroll;
|
||||
static int stamp_scroll[MAX_STAMP_GROUPS];
|
||||
static int font_scroll, magic_scroll, tool_scroll;
|
||||
|
|
@ -8248,7 +8248,7 @@ static SDL_Surface *thumbnail2(SDL_Surface * src, int max_x, int max_y,
|
|||
Uint32(*getpixel) (SDL_Surface *, int, int) =
|
||||
getpixels[src->format->BytesPerPixel];
|
||||
|
||||
|
||||
/* FIXME: Deal with gamma, per: http://www.4p8.com/eric.brasseur/gamma.html */
|
||||
/* Determine scale and centering offsets: */
|
||||
|
||||
if (!keep_aspect)
|
||||
|
|
@ -10152,7 +10152,7 @@ static void autoscale_copy_smear_free(SDL_Surface * src, SDL_Surface * dst,
|
|||
static void load_starter_id(char *saved_id)
|
||||
{
|
||||
char *rname;
|
||||
char fname[NAME_MAX];
|
||||
char fname[FILENAME_MAX];
|
||||
FILE *fi;
|
||||
char color_tag;
|
||||
int r, g, b;
|
||||
|
|
@ -19425,8 +19425,10 @@ static void setup_config(char *argv[])
|
|||
|
||||
// FIXME: most of this is not required before starting the font scanner
|
||||
|
||||
#ifdef PAPER_H
|
||||
if(tmpcfg_cmd.papersize && !strcmp(tmpcfg_cmd.papersize, "help"))
|
||||
show_available_papersizes(0);
|
||||
#endif
|
||||
|
||||
#define SETBOOL(x) do{ if(tmpcfg.x) x = (tmpcfg.x==PARSE_YES); }while(0)
|
||||
SETBOOL(all_locale_fonts);
|
||||
|
|
@ -19504,10 +19506,12 @@ static void setup_config(char *argv[])
|
|||
strcpy(colorfile, tmpcfg.colorfile); // FIXME can overflow
|
||||
if(tmpcfg.print_delay)
|
||||
print_delay = atoi(tmpcfg.print_delay);
|
||||
#ifdef PAPER_H
|
||||
if(tmpcfg.printcommand)
|
||||
printcommand = tmpcfg.printcommand;
|
||||
if(tmpcfg.altprintcommand)
|
||||
altprintcommand = tmpcfg.altprintcommand;
|
||||
#endif
|
||||
if(tmpcfg.alt_print_command_default)
|
||||
{
|
||||
// FIXME: probably need extra variables
|
||||
|
|
@ -19518,8 +19522,10 @@ static void setup_config(char *argv[])
|
|||
else
|
||||
alt_print_command_default = ALTPRINT_MOD; // default ("mod")
|
||||
}
|
||||
#ifdef PAPER_H
|
||||
if(tmpcfg.papersize)
|
||||
papersize = tmpcfg.papersize;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue