Francois Gouget : wordpad: Fix compilation on systems that don' t support nameless unions.

Alexandre Julliard julliard at winehq.org
Tue Sep 18 05:31:14 CDT 2007


Module: wine
Branch: master
Commit: 03d7f2d4ade297935d9184e2f333132dfc82541e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=03d7f2d4ade297935d9184e2f333132dfc82541e

Author: Francois Gouget <fgouget at free.fr>
Date:   Tue Sep 18 00:39:11 2007 +0200

wordpad: Fix compilation on systems that don't support nameless unions.

---

 programs/wordpad/wordpad.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index 431e9d7..5e1d0dc 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -40,6 +40,16 @@
 
 #include "resource.h"
 
+#ifdef NONAMELESSUNION
+# define U(x)  (x).u
+# define U2(x) (x).u2
+# define U3(x) (x).u3
+#else
+# define U(x)  (x)
+# define U2(x) (x)
+# define U3(x) (x)
+#endif
+
 /* use LoadString */
 static const WCHAR xszAppTitle[] = {'W','i','n','e',' ','W','o','r','d','p','a','d',0};
 static const WCHAR xszMainMenu[] = {'M','A','I','N','M','E','N','U',0};
@@ -1773,7 +1783,7 @@ static void dialog_viewproperties(void)
 
     psp[0].dwSize = sizeof(PROPSHEETPAGEW);
     psp[0].dwFlags = PSP_USETITLE;
-    psp[0].pszTemplate = MAKEINTRESOURCEW(IDD_FORMATOPTS);
+    U(psp[0]).pszTemplate = MAKEINTRESOURCEW(IDD_FORMATOPTS);
     psp[0].pfnDlgProc = formatopts_proc;
     psp[0].hInstance = hInstance;
     psp[0].lParam = reg_formatindex(SF_TEXT);
@@ -1783,7 +1793,7 @@ static void dialog_viewproperties(void)
     {
         psp[i].dwSize = psp[0].dwSize;
         psp[i].dwFlags = psp[0].dwFlags;
-        psp[i].pszTemplate = psp[0].pszTemplate;
+        U(psp[i]).pszTemplate = U(psp[0]).pszTemplate;
         psp[i].pfnDlgProc = psp[0].pfnDlgProc;
         psp[i].hInstance = psp[0].hInstance;
         psp[i].lParam = reg_formatindex(SF_RTF);
@@ -1797,13 +1807,13 @@ static void dialog_viewproperties(void)
     psh.hInstance = hInstance;
     psh.pszCaption = MAKEINTRESOURCEW(STRING_VIEWPROPS_TITLE);
     psh.nPages = sizeof(psp)/sizeof(psp[0]);
-    psh.ppsp = ppsp;
-    psh.pszIcon = MAKEINTRESOURCEW(IDI_WORDPAD);
+    U3(psh).ppsp = ppsp;
+    U(psh).pszIcon = MAKEINTRESOURCEW(IDI_WORDPAD);
 
     if(fileFormat & SF_RTF)
-        psh.nStartPage = 1;
+        U2(psh).nStartPage = 1;
     else
-        psh.nStartPage = 0;
+        U2(psh).nStartPage = 0;
     PropertySheetW(&psh);
     set_bar_states();
     target_device();




More information about the wine-cvs mailing list