gdiplus: Define namespace macros so we can unify the C and C++ #include lists.

Francois Gouget fgouget at free.fr
Thu Aug 2 17:52:43 CDT 2007


---

It seems more maintainable to me with just one copy of the #includes...

 include/gdiplus.h |   71 ++++++++++++++++++++++------------------------------
 1 files changed, 30 insertions(+), 41 deletions(-)

diff --git a/include/gdiplus.h b/include/gdiplus.h
index 9e72f52..044bb94 100644
--- a/include/gdiplus.h
+++ b/include/gdiplus.h
@@ -20,44 +20,33 @@
 #define _GDIPLUS_H
 
 #ifdef __cplusplus
-
-namespace Gdiplus
-{
-    namespace DllExports
-    {
-#include "gdiplusmem.h"
-    };
-
-#include "gdiplustypes.h"
-#include "gdiplusenums.h"
-#include "gdiplusinit.h"
-#include "gdipluspixelformats.h"
-#include "gdiplusmetaheader.h"
-#include "gdiplusimaging.h"
-#include "gdipluscolormatrix.h"
-#include "gdiplusgpstubs.h"
-
-    namespace DllExports
-    {
-#include "gdiplusflat.h"
-    };
-};
-
-#else /* end c++ includes */
-
-#include "gdiplusmem.h"
-
-#include "gdiplustypes.h"
-#include "gdiplusenums.h"
-#include "gdiplusinit.h"
-#include "gdipluspixelformats.h"
-#include "gdiplusmetaheader.h"
-#include "gdiplusimaging.h"
-#include "gdipluscolormatrix.h"
-#include "gdiplusgpstubs.h"
-
-#include "gdiplusflat.h"
-
-#endif /* end c includes */
-
-#endif /* _GDIPLUS_H_ */
+# define WINELIB_START_NAMESPACE(ns) namespace ns {
+# define WINELIB_END_NAMESPACE()     };
+#else
+# define WINELIB_START_NAMESPACE(ns)
+# define WINELIB_END_NAMESPACE()
+#endif
+
+WINELIB_START_NAMESPACE(Gdiplus)
+  WINELIB_START_NAMESPACE(DllExports)
+#   include "gdiplusmem.h"
+  WINELIB_END_NAMESPACE()
+
+# include "gdiplustypes.h"
+# include "gdiplusenums.h"
+# include "gdiplusinit.h"
+# include "gdipluspixelformats.h"
+# include "gdiplusmetaheader.h"
+# include "gdiplusimaging.h"
+# include "gdipluscolormatrix.h"
+# include "gdiplusgpstubs.h"
+
+  WINELIB_START_NAMESPACE(DllExports)
+#   include "gdiplusflat.h"
+  WINELIB_END_NAMESPACE()
+WINELIB_END_NAMESPACE()
+
+#undef WINELIB_START_NAMESPACE
+#undef WINELIB_END_NAMESPACE
+
+#endif /* _GDIPLUS_H */
-- 
1.4.4.4




More information about the wine-patches mailing list