From 4ad1e6fedbbdf47ea996f317de13d5cd5c5e206e Mon Sep 17 00:00:00 2001 From: Earnie Boyd Date: Tue, 28 May 2002 13:13:45 +0000 Subject: Merging MinGW changes --- winsup/mingw/samples/dlltest/silly.cpp | 110 ++++++++++++++++----------------- 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'winsup/mingw/samples/dlltest/silly.cpp') diff --git a/winsup/mingw/samples/dlltest/silly.cpp b/winsup/mingw/samples/dlltest/silly.cpp index 70f5af5c7..ee9e1fe77 100644 --- a/winsup/mingw/samples/dlltest/silly.cpp +++ b/winsup/mingw/samples/dlltest/silly.cpp @@ -1,55 +1,55 @@ -// -// C++ test of a dll which contains a C++ class. -// - -#include -#include - -// Interface of class. -#include "silly.h" - -#ifdef DERIVED_TEST -// Here is a derived class too. -class CMoreSilly : public CSilly -{ - public: - CMoreSilly (char* szNewName) : CSilly (szNewName) {}; - ~CMoreSilly (); - - WhatsYourName(); -}; - -CMoreSilly:: -~CMoreSilly () -{ - printf ("In CMoreSilly \"%s\" destructor!\n", szName); -} - -CMoreSilly:: -WhatsYourName () -{ - printf ("I'm more silly and my name is \"%s\"\n", szName); -} -#endif - -int -main () -{ - CSilly* psilly = new CSilly("silly"); - - psilly->WhatsYourName(); - psilly->Poke(); // Poke him, he should say "Ouch!" - psilly->Stab(4); // Stab him four times he should say "Ugh!!!!" - - delete psilly; - -#ifdef DERIVED_TEST - psilly = new CMoreSilly("more silly"); - psilly->WhatsYourName(); - psilly->Stab(5); - delete psilly; -#endif - - return 0; -} - +// +// C++ test of a dll which contains a C++ class. +// + +#include +#include + +// Interface of class. +#include "silly.h" + +#ifdef DERIVED_TEST +// Here is a derived class too. +class CMoreSilly : public CSilly +{ + public: + CMoreSilly (char* szNewName) : CSilly (szNewName) {}; + ~CMoreSilly (); + + WhatsYourName(); +}; + +CMoreSilly:: +~CMoreSilly () +{ + printf ("In CMoreSilly \"%s\" destructor!\n", szName); +} + +CMoreSilly:: +WhatsYourName () +{ + printf ("I'm more silly and my name is \"%s\"\n", szName); +} +#endif + +int +main () +{ + CSilly* psilly = new CSilly("silly"); + + psilly->WhatsYourName(); + psilly->Poke(); // Poke him, he should say "Ouch!" + psilly->Stab(4); // Stab him four times he should say "Ugh!!!!" + + delete psilly; + +#ifdef DERIVED_TEST + psilly = new CMoreSilly("more silly"); + psilly->WhatsYourName(); + psilly->Stab(5); + delete psilly; +#endif + + return 0; +} + -- cgit v1.2.3