summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-30 02:06:57 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-30 02:06:57 +0000
commit72dba72cb51730f0f6e76ee876181adb3781e02d (patch)
tree0e1055502cc2137c0ea8d25c6fe3631db2d7cb1a
parentd833c6d9baa65caba564ae60bbb723a255ed0d97 (diff)
downloadATCD-72dba72cb51730f0f6e76ee876181adb3781e02d.tar.gz
*** empty log message ***
-rw-r--r--examples/DLL/Newsweek.cpp28
-rw-r--r--examples/DLL/Today.cpp33
2 files changed, 12 insertions, 49 deletions
diff --git a/examples/DLL/Newsweek.cpp b/examples/DLL/Newsweek.cpp
index f48d7700ea7..0a6c63dc1ff 100644
--- a/examples/DLL/Newsweek.cpp
+++ b/examples/DLL/Newsweek.cpp
@@ -1,25 +1,8 @@
// $Id$
-#include "Newsweek.h"
-
-// @@ Kirthika, please see the comments in the Today.cpp file to see
-// my recommendations for simplifying this stuff.
-
-// This declaration necessary to get thi sworking on NT.
-#if defined (ACE_HAS_WIN32)
-
-#ifdef __cplusplus
-extern "C" { // only need to export C interface if
- // used by C++ source code
-#endif
+#define ACE_BUILD_SVC_DLL
- __declspec( dllexport ) Magazine *create_magazine (void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+#include "Newsweek.h"
// Implementation of the abstract class method which describes
// the magazine.
@@ -31,9 +14,12 @@ void Newsweek::title (void)
}
// Returns the Newsweek class pointer.
+// The ACE_BUILD_SVC_DLL and ACE_Svc_Export directives are necessary as take care
+// of exporting the function for Win32 platforms.
+extern "C" ACE_Svc_Export Magazine *create_magazine (void);
-extern "C"
-Magazine *create_magazine (void)
+Magazine *
+create_magazine (void)
{
Magazine *mag;
ACE_NEW_RETURN (mag,
diff --git a/examples/DLL/Today.cpp b/examples/DLL/Today.cpp
index ccfa606eba0..8ee8b986b25 100644
--- a/examples/DLL/Today.cpp
+++ b/examples/DLL/Today.cpp
@@ -1,33 +1,8 @@
// $Id$
-#include "Today.h"
-
-// This declaration is necessary to get this working on NT.
-#if defined (ACE_HAS_WIN32)
+#define ACE_BUILD_SVC_DLL
-#ifdef __cplusplus
-// @@ Kirthika, this program will ALWAYS be compiled with a C++
-// compiler! Therefore, you can omit this __cplusplus #ifdef stuff...
-extern "C" { // only need to export C interface if
- // used by C++ source code
-#endif
- // @@ Kirthika, please check to see which of the ACE macros, e.g.,
- // ACE_SVC_EXPORT, or ACE_EXPORT should be used here, rather than
- // having to explicitly #ifdef your code you should use the ACE
- // macros for this.
- __declspec( dllexport ) Magazine *create_magazine (void);
-
-#ifdef __cplusplus
-}
-#endif
-
-// @@ Kirthika, please make sure that you always do something like this
-// #endif /* ACE_HAS_WIN32 */ when you close a #ifdef block. However,
-// in this case, I think you can remove the #if defined
-// (ACE_HAS_WIN32) altogether since that'll be handled by the
-// ACE_*_EXPORT macro!
-
-#endif
+#include "Today.h"
// Implementation of the abstract class method which describes the
// magazine.
@@ -40,8 +15,10 @@ Today::title (void)
}
// Returns the pointer to the Today class.
+// The ACE_BUILD_SVC_DLL and ACE_Svc_Export directives are necessary as take care
+// of exporting the function for Win32 platforms.
+extern "C" ACE_Svc_Export Magazine *create_magazine (void);
-extern "C"
Magazine *create_magazine (void)
{
Magazine *mag;