From 4a432c0c7033dc1572467f12a46e7f40273c17e7 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 26 Jul 2011 21:56:48 +0000 Subject: [PATCH] [TELNET] * Introduce a PCH. * BTW, the recent and upcoming changes are two-fold: First, having a precompiled header will increase build speed. Furthermore, PCH support allows CMake dependency tracking files to shrink drastically. For example it's (depend.make) 95% smaller for this module than it used to be. This means an even better build system compared to rbuild, not to mention it's now faster than before. * This work is dedicated to Jerome. svn path=/trunk/; revision=52904 --- .../network/telnet/CMakeLists.txt | 1 + .../network/telnet/src/ansiprsr.cpp | 3 +- .../network/telnet/src/keytrans.cpp | 16 +------ .../applications/network/telnet/src/precomp.h | 47 +++++++++++++++++++ .../network/telnet/src/tcharmap.cpp | 4 +- .../network/telnet/src/tconsole.cpp | 3 +- .../network/telnet/src/tkeydef.cpp | 3 +- .../network/telnet/src/tkeymap.cpp | 2 +- .../network/telnet/src/tmapldr.cpp | 10 +--- .../network/telnet/src/tmouse.cpp | 3 +- .../network/telnet/src/tnclass.cpp | 5 +- .../network/telnet/src/tnclip.cpp | 3 +- .../applications/network/telnet/src/tncon.cpp | 6 +-- .../network/telnet/src/tnconfig.cpp | 9 +--- .../network/telnet/src/tnerror.cpp | 8 +--- .../network/telnet/src/tnetwork.cpp | 2 +- .../network/telnet/src/tnmain.cpp | 5 +- .../network/telnet/src/tnmisc.cpp | 5 +- .../network/telnet/src/tscript.cpp | 2 +- .../network/telnet/src/tscroll.cpp | 8 +--- .../network/telnet/src/ttelhndl.cpp | 6 +-- 21 files changed, 68 insertions(+), 83 deletions(-) create mode 100644 reactos/base/applications/network/telnet/src/precomp.h diff --git a/reactos/base/applications/network/telnet/CMakeLists.txt b/reactos/base/applications/network/telnet/CMakeLists.txt index 51c76fa0ebc..74f41d0ea5b 100644 --- a/reactos/base/applications/network/telnet/CMakeLists.txt +++ b/reactos/base/applications/network/telnet/CMakeLists.txt @@ -26,5 +26,6 @@ add_executable(telnet telnet.rc) set_module_type(telnet win32cui) +add_pch(telnet src/precomp.h) add_importlibs(telnet ws2_32 user32 msvcrt kernel32) add_cd_file(TARGET telnet DESTINATION reactos/system32 FOR all) diff --git a/reactos/base/applications/network/telnet/src/ansiprsr.cpp b/reactos/base/applications/network/telnet/src/ansiprsr.cpp index e24f44fea35..1263733e988 100644 --- a/reactos/base/applications/network/telnet/src/ansiprsr.cpp +++ b/reactos/base/applications/network/telnet/src/ansiprsr.cpp @@ -50,8 +50,7 @@ /////////////////////////////////////////////////////////////////////////////// //#include -#include -#include "ansiprsr.h" +#include "precomp.h" const int ANSIColors[] = {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; diff --git a/reactos/base/applications/network/telnet/src/keytrans.cpp b/reactos/base/applications/network/telnet/src/keytrans.cpp index 0647c8e636c..e385d11c512 100644 --- a/reactos/base/applications/network/telnet/src/keytrans.cpp +++ b/reactos/base/applications/network/telnet/src/keytrans.cpp @@ -44,21 +44,7 @@ // DeleteKeyDef : Deletes a key def from the list // /////////////////////////////////////////////////////////////////// -#include - -// changed to make work with VC++ (Paul Brannan 5/25/98) -// FIX ME !!! Ioannou: This must be __BORLANDC__ && VERSION < 5 -// but what is the directive for Borland version ???? -// FIXED Sept. 31, 2000 (Bernard Badger) -// -#if defined(__BORLANDC__) && (__BORLANDC < 0x0500) -#include -#else -#include -#endif - -#include "keytrans.h" -#include "tnerror.h" +#include "precomp.h" ///////////////////////////////////////////////////////////// // class KeyTranslator // diff --git a/reactos/base/applications/network/telnet/src/precomp.h b/reactos/base/applications/network/telnet/src/precomp.h new file mode 100644 index 00000000000..373e06f5c44 --- /dev/null +++ b/reactos/base/applications/network/telnet/src/precomp.h @@ -0,0 +1,47 @@ +#include "ansiprsr.h" + +#if defined(__BORLANDC__) && (__BORLANDC < 0x0500) +#include +#else +#include +#endif + +#ifdef __BORLANDC__ +#include +#else +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "keytrans.h" +#include "tnerror.h" +#include "tcharmap.h" +#include "tnconfig.h" +#include "tconsole.h" +#include "tkeydef.h" +#include "tkeymap.h" +#include "tmapldr.h" +#include "tmouse.h" +#include "tnclass.h" +#include "tnmisc.h" +#include "tnclip.h" +#include "tncon.h" +#include "ttelhndl.h" +#include "tnetwork.h" +#include "tnmain.h" +#include "tscript.h" +#include "tscroll.h" +#include "telnet.h" +#include "tparams.h" diff --git a/reactos/base/applications/network/telnet/src/tcharmap.cpp b/reactos/base/applications/network/telnet/src/tcharmap.cpp index 23564c8b872..4bc461e8279 100644 --- a/reactos/base/applications/network/telnet/src/tcharmap.cpp +++ b/reactos/base/applications/network/telnet/src/tcharmap.cpp @@ -28,9 +28,7 @@ // Written by Paul Brannan // Last modified 7/12/98 -#include -#include "tcharmap.h" -#include "tnconfig.h" +#include "precomp.h" // map B (US ASCII) // this maps each character to itself diff --git a/reactos/base/applications/network/telnet/src/tconsole.cpp b/reactos/base/applications/network/telnet/src/tconsole.cpp index ec866816c0d..97449aa04ca 100644 --- a/reactos/base/applications/network/telnet/src/tconsole.cpp +++ b/reactos/base/applications/network/telnet/src/tconsole.cpp @@ -46,8 +46,7 @@ // /////////////////////////////////////////////////////////////////////////////// -#include -#include "tconsole.h" +#include "precomp.h" // argsused doesn't work on MSVC++ #ifdef __BORLANDC__ diff --git a/reactos/base/applications/network/telnet/src/tkeydef.cpp b/reactos/base/applications/network/telnet/src/tkeydef.cpp index e1803271826..2d3e2120a08 100644 --- a/reactos/base/applications/network/telnet/src/tkeydef.cpp +++ b/reactos/base/applications/network/telnet/src/tkeydef.cpp @@ -29,8 +29,7 @@ // originally part of KeyTrans.cpp // ///////////////////////////////////////////////////////// -#include "tkeydef.h" -#include +#include "precomp.h" // This class did not properly release memory before, and a buffer overrun // was apparent in operator=(char*). Fixed. (Paul Brannan Feb. 4, 1999) diff --git a/reactos/base/applications/network/telnet/src/tkeymap.cpp b/reactos/base/applications/network/telnet/src/tkeymap.cpp index e1730f5a8bf..c62020a6672 100644 --- a/reactos/base/applications/network/telnet/src/tkeymap.cpp +++ b/reactos/base/applications/network/telnet/src/tkeymap.cpp @@ -29,7 +29,7 @@ // originally part of KeyTrans.cpp // ///////////////////////////////////////////////////////// -#include "tkeymap.h" +#include "precomp.h" KeyMap::KeyMap(DWORD state, DWORD code): map(0,0,sizeof(TKeyDef)), key(NULL,state,code) {}; diff --git a/reactos/base/applications/network/telnet/src/tmapldr.cpp b/reactos/base/applications/network/telnet/src/tmapldr.cpp index 18e2d621a60..3680645db11 100644 --- a/reactos/base/applications/network/telnet/src/tmapldr.cpp +++ b/reactos/base/applications/network/telnet/src/tmapldr.cpp @@ -29,15 +29,7 @@ // originally part of KeyTrans.cpp // ///////////////////////////////////////////////////////// -#include "tmapldr.h" -#include "tnconfig.h" - -#ifdef __BORLANDC__ -#include -#else -#include -#include -#endif +#include "precomp.h" // It's probably a good idea to turn off the "identifier was truncated" warning // in MSVC (Paul Brannan 5/25/98) diff --git a/reactos/base/applications/network/telnet/src/tmouse.cpp b/reactos/base/applications/network/telnet/src/tmouse.cpp index 322965bc5a3..317289dcf95 100644 --- a/reactos/base/applications/network/telnet/src/tmouse.cpp +++ b/reactos/base/applications/network/telnet/src/tmouse.cpp @@ -28,8 +28,7 @@ // Written by Paul Brannan // Last modified August 30, 1998 -#include "tmouse.h" -#include "tconsole.h" +#include "precomp.h" TMouse::TMouse(Tnclip &RefClipboard): Clipboard(RefClipboard) { hConsole = GetStdHandle(STD_INPUT_HANDLE); diff --git a/reactos/base/applications/network/telnet/src/tnclass.cpp b/reactos/base/applications/network/telnet/src/tnclass.cpp index b7a1f835310..8998523bb60 100644 --- a/reactos/base/applications/network/telnet/src/tnclass.cpp +++ b/reactos/base/applications/network/telnet/src/tnclass.cpp @@ -41,10 +41,7 @@ // /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include "tnclass.h" -#include "tnmisc.h" +#include "precomp.h" // Mingw32 needs these (Paul Brannan 9/4/98) #ifndef ICON_SMALL diff --git a/reactos/base/applications/network/telnet/src/tnclip.cpp b/reactos/base/applications/network/telnet/src/tnclip.cpp index 54f3eba2308..ec47838614e 100644 --- a/reactos/base/applications/network/telnet/src/tnclip.cpp +++ b/reactos/base/applications/network/telnet/src/tnclip.cpp @@ -28,8 +28,7 @@ // Written by Paul Brannan // Last modified 7/12/98 -#include -#include "tnclip.h" +#include "precomp.h" Tnclip::Tnclip(HWND W, TNetwork &RefNetwork): Network(RefNetwork) { Window = W; diff --git a/reactos/base/applications/network/telnet/src/tncon.cpp b/reactos/base/applications/network/telnet/src/tncon.cpp index 10e9d4d0aed..6681317f2ee 100644 --- a/reactos/base/applications/network/telnet/src/tncon.cpp +++ b/reactos/base/applications/network/telnet/src/tncon.cpp @@ -43,10 +43,8 @@ // Original code // /////////////////////////////////////////////////////////////////////////////// -#include "tncon.h" -#include "keytrans.h" -#include "ttelhndl.h" -#include "tconsole.h" + +#include "precomp.h" #define KEYEVENT InputRecord[i].Event.KeyEvent diff --git a/reactos/base/applications/network/telnet/src/tnconfig.cpp b/reactos/base/applications/network/telnet/src/tnconfig.cpp index 5bd8dfaef21..9a9ad5ce192 100644 --- a/reactos/base/applications/network/telnet/src/tnconfig.cpp +++ b/reactos/base/applications/network/telnet/src/tnconfig.cpp @@ -30,14 +30,7 @@ // This is a class designed for use with Brad Johnson's Console Telnet // see the file tnconfig.h for more information -#include -#include -#include -#include -#include -#include -#include -#include "tnconfig.h" +#include "precomp.h" // Turn off the "forcing value to bool 'true' or 'false'" warning #ifdef _MSC_VER diff --git a/reactos/base/applications/network/telnet/src/tnerror.cpp b/reactos/base/applications/network/telnet/src/tnerror.cpp index 74249cb55a0..1a77ed9bc2b 100644 --- a/reactos/base/applications/network/telnet/src/tnerror.cpp +++ b/reactos/base/applications/network/telnet/src/tnerror.cpp @@ -42,13 +42,7 @@ // /////////////////////////////////////////////////////////////////////////////// -#include "tnerror.h" -#include "ttelhndl.h" // Paul Brannan 5/25/98 -#include "tnconfig.h" // Paul Brannan 5/25/98 -#include -#include -#include -#include +#include "precomp.h" #ifndef LANG_USER_DEFAULT #define LANG_USER_DEFAULT 400 diff --git a/reactos/base/applications/network/telnet/src/tnetwork.cpp b/reactos/base/applications/network/telnet/src/tnetwork.cpp index 64eed9be358..8cab0d564bd 100644 --- a/reactos/base/applications/network/telnet/src/tnetwork.cpp +++ b/reactos/base/applications/network/telnet/src/tnetwork.cpp @@ -35,7 +35,7 @@ // /////////////////////////////////////////////////////////////////////////////// -#include "tnetwork.h" +#include "precomp.h" void TNetwork::SetSocket(SOCKET s) { socket = s; diff --git a/reactos/base/applications/network/telnet/src/tnmain.cpp b/reactos/base/applications/network/telnet/src/tnmain.cpp index 011686baa78..0fc983b2cd3 100644 --- a/reactos/base/applications/network/telnet/src/tnmain.cpp +++ b/reactos/base/applications/network/telnet/src/tnmain.cpp @@ -42,10 +42,7 @@ // /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include "tnmain.h" -#include "tnmisc.h" +#include "precomp.h" int telCommandLine (Telnet &MyConnection); diff --git a/reactos/base/applications/network/telnet/src/tnmisc.cpp b/reactos/base/applications/network/telnet/src/tnmisc.cpp index 25e319a81aa..0698b19fccd 100644 --- a/reactos/base/applications/network/telnet/src/tnmisc.cpp +++ b/reactos/base/applications/network/telnet/src/tnmisc.cpp @@ -1,7 +1,4 @@ -#include -#include - -#include "tnmisc.h" +#include "precomp.h" // from the PVAX (http://www.ccas.ru/~posp/popov/spawn.htm) // Create a process with pipes to stdin/out/err diff --git a/reactos/base/applications/network/telnet/src/tscript.cpp b/reactos/base/applications/network/telnet/src/tscript.cpp index 2045e43ce17..24774a77683 100644 --- a/reactos/base/applications/network/telnet/src/tscript.cpp +++ b/reactos/base/applications/network/telnet/src/tscript.cpp @@ -23,7 +23,7 @@ // /////////////////////////////////////////////////////////////////////////// -#include "tscript.h" +#include "precomp.h" // FIX ME!! This code not yet functional. diff --git a/reactos/base/applications/network/telnet/src/tscroll.cpp b/reactos/base/applications/network/telnet/src/tscroll.cpp index 6c8294ede4a..0b2a3e19d18 100644 --- a/reactos/base/applications/network/telnet/src/tscroll.cpp +++ b/reactos/base/applications/network/telnet/src/tscroll.cpp @@ -38,13 +38,7 @@ // /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#include "tscroll.h" -#include "tncon.h" -#include "tconsole.h" -#include "tnconfig.h" +#include "precomp.h" enum { HEX, diff --git a/reactos/base/applications/network/telnet/src/ttelhndl.cpp b/reactos/base/applications/network/telnet/src/ttelhndl.cpp index 0020f3558f3..9caabc1be83 100644 --- a/reactos/base/applications/network/telnet/src/ttelhndl.cpp +++ b/reactos/base/applications/network/telnet/src/ttelhndl.cpp @@ -38,11 +38,7 @@ // /////////////////////////////////////////////////////////////////////////////// -#include -#include "ttelhndl.h" -#include "telnet.h" -#include "tnconfig.h" -#include "tparams.h" +#include "precomp.h" int naws_string(char *buf, int width, int height);