Alexey Savelyev's mkfiles.pl patch to support lcc-win32. This has
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 20 Jan 2004 20:35:27 +0000 (20:35 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 20 Jan 2004 20:35:27 +0000 (20:35 +0000)
caused a small amount of extra inconvenience at the tops of .rc
files, but it's been positive overall since lcc has managed to point
out some pedantic errors (typically static/extern mismatches between
function prototypes and definitions) which everything else missed.

git-svn-id: svn://svn.tartarus.org/sgt/putty@3744 cda61777-01e9-0310-a592-d414129be87e

mkfiles.pl
pageant.c
pageant.rc
printing.c
puttygen.rc
win_res.rc
windlg.c
window.c

index f9c48c0..be9f01f 100755 (executable)
@@ -988,3 +988,62 @@ foreach $arch (qw(PPC Carbon)) {
      }
 }
 select STDOUT; close OUT;
+
+##-- lcc makefile
+open OUT, ">Makefile.lcc"; select OUT;
+print
+"# Makefile for PuTTY under lcc.\n".
+"#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
+"# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
+# lcc command line option is -D not /D
+($_ = $help) =~ s/=\/D/=-D/gs;
+print $_;
+print
+"\n".
+"# If you rename this file to `Makefile', you should change this line,\n".
+"# so that the .rsp files still depend on the correct makefile.\n".
+"MAKEFILE = Makefile.lcc\n".
+"\n".
+"# C compilation flags\n".
+"CFLAGS = -D_WINDOWS\n".
+"\n".
+"# Get include directory for resource compiler\n".
+"\n".
+".c.obj:\n".
+&splitline("\tlcc -O -p6 \$(COMPAT) \$(FWHACK)".
+  " \$(XFLAGS) \$(CFLAGS)  \$*.c",69)."\n".
+".rc.res:\n".
+&splitline("\tlrc \$(FWHACK) \$(RCFL) -r \$*.rc",69)."\n".
+"\n";
+print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("GC"));
+print "\n\n";
+foreach $p (&prognames("GC")) {
+  ($prog, $type) = split ",", $p;
+  $objstr = &objects($p, "X.obj", "X.res", undef);
+  print &splitline("$prog.exe: " . $objstr ), "\n";
+  $subsystemtype = undef;
+  if ($prog eq "pageant" || $prog eq "putty" ||$prog eq "puttygen" || $prog eq "puttytel") { 
+       $subsystemtype = "-subsystem  windows"; }
+  my $libss = "shell32.lib wsock32.lib ws2_32.lib winspool.lib winmm.lib imm32.lib";
+  print &splitline("\tlcclnk $subsystemtype -o $prog.exe $objstr $libss");
+  print "\n\n";
+}
+
+
+foreach $d (&deps("X.obj", "X.res", "", "\\")) {
+  print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
+    "\n";
+}
+print
+"\n".
+"version.o: FORCE\n".
+"# Hack to force version.o to be rebuilt always\n".
+"FORCE:\n".
+"\tlcc \$(FWHACK) \$(VER) \$(CFLAGS) /c version.c\n\n".
+"clean:\n".
+"\t-del *.obj\n".
+"\t-del *.exe\n".
+"\t-del *.res\n";
+
+select STDOUT; close OUT;
+
index 9d39e46..3ac9ca7 100644 (file)
--- a/pageant.c
+++ b/pageant.c
@@ -13,6 +13,8 @@
 #include "misc.h"
 #include "tree234.h"
 
+#include <shellapi.h>
+
 #ifndef NO_SECURITY
 #include <aclapi.h>
 #endif
@@ -49,7 +51,7 @@ static HMENU systray_menu, session_menu;
 static int already_running;
 static int requested_help;
 
-static char *help_path;
+char *help_path;
 static char *putty_path;
 
 #define IDM_PUTTY         0x0060
index 4105036..be532fb 100644 (file)
@@ -1,4 +1,8 @@
 /* Some compilers, like Borland, don't have winresrc.h */
+#ifdef __LCC__ 
+#include <win.h>
+#else
+
 #ifndef NO_WINRESRC_H
 #ifndef MSVC4
 #include <winresrc.h>
@@ -7,6 +11,8 @@
 #endif
 #endif
 
+#endif /* end #ifdef __LCC__
+
 /* Some systems don't define this, so I do it myself if necessary */
 #ifndef RT_MANIFEST
 #define RT_MANIFEST 24
index 6248881..b869652 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include "putty.h"
+#include <winspool.h>
 
 struct printer_enum_tag {
     int nprinters;
index e1e0e08..ffef2ec 100644 (file)
@@ -1,4 +1,8 @@
 /* Some compilers, like Borland, don't have winresrc.h */
+#ifdef __LCC__ 
+#include <win.h>
+#else
+
 #ifndef NO_WINRESRC_H
 #ifndef MSVC4
 #include <winresrc.h>
@@ -7,6 +11,8 @@
 #endif
 #endif
 
+#endif /* end #ifdef __LCC__
+
 /* Some systems don't define this, so I do it myself if necessary */
 #ifndef RT_MANIFEST
 #define RT_MANIFEST 24
index d1fb112..cd8bc3c 100644 (file)
@@ -1,4 +1,8 @@
 /* Some compilers, like Borland, don't have winresrc.h */
+#ifdef __LCC__ 
+#include <win.h>
+#else
+
 #ifndef NO_WINRESRC_H
 #ifndef MSVC4
 #include <winresrc.h>
@@ -7,6 +11,8 @@
 #endif
 #endif
 
+#endif /* end #ifdef __LCC__
+
 /* Some systems don't define this, so I do it myself if necessary */
 #ifndef TCS_MULTILINE
 #define TCS_MULTILINE 0x0200
index a7c3776..9c24449 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -13,6 +13,7 @@
 
 #include <commctrl.h>
 #include <commdlg.h>
+#include <shellapi.h>
 
 #ifdef MSVC4
 #define TVINSERTSTRUCT  TV_INSERTSTRUCT
index 9a9a5ce..f13f0d4 100644 (file)
--- a/window.c
+++ b/window.c
@@ -110,7 +110,6 @@ static struct unicode_data ucsdata;
 static int session_closed;
 
 static const struct telnet_special *specials;
-static int specials_menu_position;
 
 static struct {
     HMENU menu;
@@ -4601,7 +4600,7 @@ char *get_window_title(void *frontend, int icon)
 /*
  * See if we're in full-screen mode.
  */
-int is_full_screen()
+static int is_full_screen()
 {
     if (!IsZoomed(hwnd))
        return FALSE;
@@ -4640,7 +4639,7 @@ static int get_fullscreen_rect(RECT * ss)
  * Go full-screen. This should only be called when we are already
  * maximised.
  */
-void make_full_screen()
+static void make_full_screen()
 {
     DWORD style;
        RECT ss;
@@ -4674,7 +4673,7 @@ void make_full_screen()
 /*
  * Clear the full-screen attributes.
  */
-void clear_full_screen()
+static void clear_full_screen()
 {
     DWORD oldstyle, style;
 
@@ -4704,7 +4703,7 @@ void clear_full_screen()
 /*
  * Toggle full-screen mode.
  */
-void flip_full_screen()
+static void flip_full_screen()
 {
     if (is_full_screen()) {
        ShowWindow(hwnd, SW_RESTORE);