diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-02-22 12:09:38 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-02-22 12:09:38 +0000 |
commit | b287d7f6a13823ea17e0bd415981d3a5953ca703 (patch) | |
tree | a420b28a35f7761f064d50bb610dbb2b46c71486 /Build/source/texk/web2c/window | |
parent | 5fd6fd3479fcbbda52ebca7b5e80a5aaa1add69f (diff) |
build system: various small fixes for mingw32 cross compilation
still incomplete
git-svn-id: svn://tug.org/texlive/trunk@17141 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/window')
-rw-r--r-- | Build/source/texk/web2c/window/ChangeLog | 20 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/Makefile.am | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/Makefile.in | 14 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/amiga.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/epsf.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/hp2627.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/mfdisplay.h | 24 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/mftalk.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/next.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/regis.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/suntools.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/tek.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/trap.c | 13 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/uniterm.c | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/win32.c | 15 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/x11-Xlib.c | 13 | ||||
-rw-r--r-- | Build/source/texk/web2c/window/x11-Xt.c | 13 |
17 files changed, 91 insertions, 49 deletions
diff --git a/Build/source/texk/web2c/window/ChangeLog b/Build/source/texk/web2c/window/ChangeLog index 6d9788db385..feab3a70fea 100644 --- a/Build/source/texk/web2c/window/ChangeLog +++ b/Build/source/texk/web2c/window/ChangeLog @@ -1,3 +1,23 @@ +2010-02-21 Peter Breitenlohner <peb@mppmu.mpg.de> + + * mfdisplay.h: New file with protos for display routines. + * Makefile.am: Add the new file. + + * amiga.c, epsf.c, mftalk.c + #include <mfdisplay.h>, mf_*_initscreen returns int. + + * hp2627.c, next.c, regis.c, suntools.c, tek.c, uniterm.c + #include <mfdisplay.h>. + + * trap.c: mf_trap_initscreen() returns int. + #include <mfdisplay.h> and drop externs. + + * win32.c: #include <mfdisplay.h>. + Do not skip Win32Error() for MinGW32, add static forward decl. + Drop unused variables szAppName, black, and white. + + * x11-Xlib.c, x11-Xt.c: #include <mfdisplay.h> and drop externs. + 2010-01-20 Peter Breitenlohner <peb@mppmu.mpg.de> * amiga.c, win32.c: Current METAFONT Version is 2.718281. diff --git a/Build/source/texk/web2c/window/Makefile.am b/Build/source/texk/web2c/window/Makefile.am index 81312a73693..605e300c3d0 100644 --- a/Build/source/texk/web2c/window/Makefile.am +++ b/Build/source/texk/web2c/window/Makefile.am @@ -1,6 +1,6 @@ ## Makefile.am for the TeX Live subdirectory texk/web2c/window/ ## -## Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org> +## Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. ## INCLUDES = -I$(top_srcdir) $(KPATHSEA_INCLUDES) @@ -18,6 +18,7 @@ libwindow_a_SOURCES = \ amiga.c \ epsf.c \ hp2627.c \ + mfdisplay.h \ mftalk.c \ next.c \ regis.c \ diff --git a/Build/source/texk/web2c/window/Makefile.in b/Build/source/texk/web2c/window/Makefile.in index 7baaacba326..0e133d95e39 100644 --- a/Build/source/texk/web2c/window/Makefile.in +++ b/Build/source/texk/web2c/window/Makefile.in @@ -77,9 +77,9 @@ CONFIG_CLEAN_VPATH_FILES = ARFLAGS = cru libwindow_a_AR = $(AR) $(ARFLAGS) libwindow_a_LIBADD = -am__libwindow_a_SOURCES_DIST = amiga.c epsf.c hp2627.c mftalk.c next.c \ - regis.c suntools.c tek.c trap.c uniterm.c win32.c x11-Xt.c \ - x11-Xlib.c +am__libwindow_a_SOURCES_DIST = amiga.c epsf.c hp2627.c mfdisplay.h \ + mftalk.c next.c regis.c suntools.c tek.c trap.c uniterm.c \ + win32.c x11-Xt.c x11-Xlib.c @MFXT_TRUE@am__objects_1 = x11-Xt.$(OBJEXT) @MFXT_FALSE@am__objects_2 = x11-Xlib.$(OBJEXT) am_libwindow_a_OBJECTS = amiga.$(OBJEXT) epsf.$(OBJEXT) \ @@ -109,6 +109,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -128,6 +129,7 @@ CXXLD = @CXXLD@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -294,9 +296,9 @@ INCLUDES = -I$(top_srcdir) $(KPATHSEA_INCLUDES) AM_CPPFLAGS = $(X_CFLAGS) AM_CFLAGS = $(WARNING_CFLAGS) EXTRA_LIBRARIES = libwindow.a -libwindow_a_SOURCES = amiga.c epsf.c hp2627.c mftalk.c next.c regis.c \ - suntools.c tek.c trap.c uniterm.c win32.c $(am__append_1) \ - $(am__append_2) +libwindow_a_SOURCES = amiga.c epsf.c hp2627.c mfdisplay.h mftalk.c \ + next.c regis.c suntools.c tek.c trap.c uniterm.c win32.c \ + $(am__append_1) $(am__append_2) DISTCLEANFILES = libwindow.a all: all-am diff --git a/Build/source/texk/web2c/window/amiga.c b/Build/source/texk/web2c/window/amiga.c index c5b231abe91..e975cb39bd5 100644 --- a/Build/source/texk/web2c/window/amiga.c +++ b/Build/source/texk/web2c/window/amiga.c @@ -153,6 +153,8 @@ void close_all(void) } /* close_all() */ +#include <mfdisplay.h> + /* * INITSCREEN: Initialize the physical display window on the WorkBench * screen of the Commodore Amiga. Open the necessary libraries and open @@ -162,7 +164,7 @@ void close_all(void) * The `WFLG_SIZEGADGET' window flag has been removed; resizing the * window kills the picture and never triggered an `updatescreen'. */ -boolean mf_amiga_initscreen(void) +int mf_amiga_initscreen(void) { #ifdef DEBUG printf("\ninitscreen()\n"); diff --git a/Build/source/texk/web2c/window/epsf.c b/Build/source/texk/web2c/window/epsf.c index 238e2c2bf85..e5ed8e55c43 100644 --- a/Build/source/texk/web2c/window/epsf.c +++ b/Build/source/texk/web2c/window/epsf.c @@ -76,7 +76,9 @@ mf_epsf_header () epsf_page++; } -boolean +#include <mfdisplay.h> + +int mf_epsf_initscreen (void) { if (getenv ("MFEPSF") != (char *) NULL) diff --git a/Build/source/texk/web2c/window/hp2627.c b/Build/source/texk/web2c/window/hp2627.c index a9505644cb6..a3526e65865 100644 --- a/Build/source/texk/web2c/window/hp2627.c +++ b/Build/source/texk/web2c/window/hp2627.c @@ -68,6 +68,8 @@ static char mf_hp2627_pencolors[2] = { * sense status or something masochistic like that) */ +#include <mfdisplay.h> + int mf_hp2627_initscreen(void) { (void) fflush(stdout); /* make sure pascal-level output flushed */ diff --git a/Build/source/texk/web2c/window/mfdisplay.h b/Build/source/texk/web2c/window/mfdisplay.h new file mode 100644 index 00000000000..e001d2e36ec --- /dev/null +++ b/Build/source/texk/web2c/window/mfdisplay.h @@ -0,0 +1,24 @@ +/* mfwinlib.h: include file for Metafont display routines. + + This file is public domain. */ + +#define MF_DISPLAY_PROTOS(x) \ +extern int mf_ ## x ## _initscreen (void); \ +extern void mf_ ## x ## _updatescreen (void); \ +extern void mf_ ## x ## _blankrectangle (screencol, screencol, screenrow, screenrow); \ +extern void mf_ ## x ## _paintrow (screenrow, pixelcolor, transspec, screencol); + +MF_DISPLAY_PROTOS(amiga) +MF_DISPLAY_PROTOS(epsf) +MF_DISPLAY_PROTOS(hp2627) +MF_DISPLAY_PROTOS(mftalk) +MF_DISPLAY_PROTOS(next) +MF_DISPLAY_PROTOS(regis) +MF_DISPLAY_PROTOS(sun) +MF_DISPLAY_PROTOS(tektronix) +MF_DISPLAY_PROTOS(uniterm) +MF_DISPLAY_PROTOS(win32) +MF_DISPLAY_PROTOS(x11) +MF_DISPLAY_PROTOS(trap) + +#undef MF_DISPLAY_PROTOS diff --git a/Build/source/texk/web2c/window/mftalk.c b/Build/source/texk/web2c/window/mftalk.c index 3bfd0a65ae2..880b0b8c34f 100644 --- a/Build/source/texk/web2c/window/mftalk.c +++ b/Build/source/texk/web2c/window/mftalk.c @@ -70,7 +70,9 @@ static int buf[8]; /* Temporary buffer. */ static RETSIGTYPE (*old) (); /* Old signal handler. */ -boolean +#include <mfdisplay.h> + +int mf_mftalk_initscreen (void) { int app; /* Client application type. */ diff --git a/Build/source/texk/web2c/window/next.c b/Build/source/texk/web2c/window/next.c index e270d643184..abc4ba62ccb 100644 --- a/Build/source/texk/web2c/window/next.c +++ b/Build/source/texk/web2c/window/next.c @@ -38,6 +38,8 @@ char outstring[1024]; /* the longest string pushed though a pipe */ #undef read #endif +#include <mfdisplay.h> + int mf_next_initscreen(void) { int i; diff --git a/Build/source/texk/web2c/window/regis.c b/Build/source/texk/web2c/window/regis.c index 6d8c66d32ce..196ba946ef5 100644 --- a/Build/source/texk/web2c/window/regis.c +++ b/Build/source/texk/web2c/window/regis.c @@ -12,6 +12,8 @@ on a black background; undefined is the opposite */ #undef WRITEWHITE +#include <mfdisplay.h> + /* * int init_screen * Put screen in graphics mode:<ESC>Pp diff --git a/Build/source/texk/web2c/window/suntools.c b/Build/source/texk/web2c/window/suntools.c index b15f22c6f08..fea24dd4c16 100644 --- a/Build/source/texk/web2c/window/suntools.c +++ b/Build/source/texk/web2c/window/suntools.c @@ -80,6 +80,8 @@ Frame frame; Canvas canvas; Pixwin *pw; +#include <mfdisplay.h> + /* * init_screen: boolean; return true if window operations legal */ diff --git a/Build/source/texk/web2c/window/tek.c b/Build/source/texk/web2c/window/tek.c index 9b517d62319..077184e7253 100644 --- a/Build/source/texk/web2c/window/tek.c +++ b/Build/source/texk/web2c/window/tek.c @@ -26,6 +26,8 @@ char screen_pixel[WIDTHINBYTES*HEIGHT]; char zero_array[WIDTHINBYTES]; +#include <mfdisplay.h> + /* * function init_screen: boolean; * diff --git a/Build/source/texk/web2c/window/trap.c b/Build/source/texk/web2c/window/trap.c index 79dda11cb3c..fa30fae6fa9 100644 --- a/Build/source/texk/web2c/window/trap.c +++ b/Build/source/texk/web2c/window/trap.c @@ -7,20 +7,11 @@ /* No #ifdef for the whole file, because we always want to support this. */ -boolean mf_trap_initscreen(void); -void mf_trap_updatescreen(void); -void mf_trap_blankrectangle(screencol left, - screencol right, - screenrow top, - screenrow bottom); -void mf_trap_paintrow(screenrow row, - pixelcolor init_color, - transspec transition_vector, - screencol vector_size); +#include <mfdisplay.h> /* This returns true if we can do window operations, else false. */ -boolean +int mf_trap_initscreen(void) { return 1; diff --git a/Build/source/texk/web2c/window/uniterm.c b/Build/source/texk/web2c/window/uniterm.c index dd54a892f99..d24efc1a880 100644 --- a/Build/source/texk/web2c/window/uniterm.c +++ b/Build/source/texk/web2c/window/uniterm.c @@ -103,6 +103,9 @@ register unsigned x, y; * ESC FF - clear graphics&alpha screen. */ #define ALPHA_CLS(); (putchar('\33'), putchar('\14')) + +#include <mfdisplay.h> + int mf_uniterm_initscreen(void) { diff --git a/Build/source/texk/web2c/window/win32.c b/Build/source/texk/web2c/window/win32.c index ddfb875a4be..844e4b2e935 100644 --- a/Build/source/texk/web2c/window/win32.c +++ b/Build/source/texk/web2c/window/win32.c @@ -11,6 +11,10 @@ #ifdef WIN32WIN #include <windows.h> +#ifdef __MINGW32__ +static void Win32Error(const char *caller); +#endif + /* The following constant enables some hack that should allow the window to process its messages. Basically, the principle is to @@ -23,14 +27,11 @@ #undef DEBUG /* #define DEBUG 1 */ -static char szAppName[] = "MF"; static char szTitle[] = " MetaFont V2.718281 Online Display"; static HWND my_window; static HDC my_dc; static HDC drawing_dc; static HBITMAP hbm; -static RGBQUAD black = {0,0,0,0}; -static RGBQUAD white = {255,255,255,0}; static MSG msg; static HANDLE hAccelTable; static HANDLE hMutex; @@ -50,6 +51,8 @@ void __cdecl InitGui(void*); #endif LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam); +#include <mfdisplay.h> + int mf_win32_initscreen(void) { @@ -209,8 +212,8 @@ mf_win32_paintrow (screenrow row, ReleaseMutex(hMutex); } -#if 0 -void Win32Error(char *caller) +#ifdef __MINGW32__ +static void Win32Error(const char *caller) { LPVOID lpMsgBuf; @@ -233,7 +236,7 @@ void Win32Error(char *caller) LRESULT APIENTRY WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; - int retval; + int retval = 0; #ifdef DEBUG fprintf(stderr, "Message %x\n", iMsg); diff --git a/Build/source/texk/web2c/window/x11-Xlib.c b/Build/source/texk/web2c/window/x11-Xlib.c index 1d7b9f93940..01941d509af 100644 --- a/Build/source/texk/web2c/window/x11-Xlib.c +++ b/Build/source/texk/web2c/window/x11-Xlib.c @@ -74,18 +74,9 @@ static XWMHints wm_hints = { #define DEFAULT_X_POSITION 0 #define DEFAULT_Y_POSITION 0 -int mf_x11_initscreen(void); -void mf_x11_updatescreen(void); -void mf_x11_blankrectangle(screencol left, - screencol right, - screenrow top, - screenrow bottom); -void mf_x11_paintrow(screenrow row, - pixelcolor init_color, - transspec transition_vector, - screencol vector_size); - +#include <mfdisplay.h> + /* Return 1 (i.e., true) if display opened successfully, else 0. */ int diff --git a/Build/source/texk/web2c/window/x11-Xt.c b/Build/source/texk/web2c/window/x11-Xt.c index 46c442e2828..64d4f86e639 100644 --- a/Build/source/texk/web2c/window/x11-Xt.c +++ b/Build/source/texk/web2c/window/x11-Xt.c @@ -78,23 +78,14 @@ static XrmOptionDescRec mf_optiondesclist[] { "-bg", "background", XrmoptionSepArg, (XPointer) NULL }, }; -int mf_x11_initscreen(void); -void mf_x11_updatescreen(void); -void mf_x11_blankrectangle(screencol left, - screencol right, - screenrow top, - screenrow bottom); -void mf_x11_paintrow(screenrow row, - pixelcolor init_color, - transspec transition_vector, - screencol vector_size); - static void mf_events(void); static void mf_mapstatus(Widget w, XtPointer data, XEvent *ev); static void mf_newpixmap(unsigned int width, unsigned int height); static void mf_redraw(void); static void mf_repaint(Widget w, XtPointer data, XEvent *ev); +#include <mfdisplay.h> + /* Return 1 if display opened successfully, else 0. */ int |