Mercurial > hg > xemacs-beta
comparison src/intl-auto-encap-win32.c @ 4903:70089046adef
fix compile problems in intl-encap* under VS6
-------------------- ChangeLog entries follow: --------------------
lib-src/ChangeLog addition:
2010-01-30 Ben Wing <ben@xemacs.org>
* make-mswin-unicode.pl:
Make it possible to specify an overridden prototype in cases where
either Cygwin or Visual Studio has errors in their headers that
can be corrected by falling back to a less qualified type (typically
without const).
src/ChangeLog addition:
2010-01-30 Ben Wing <ben@xemacs.org>
* intl-auto-encap-win32.c:
* intl-auto-encap-win32.c (qxeExtractAssociatedIcon):
* intl-auto-encap-win32.c (qxeExtractIconEx):
* intl-auto-encap-win32.c (qxeCreateMDIWindow):
* intl-auto-encap-win32.c (qxeCreateWindowStation):
* intl-auto-encap-win32.c (qxeDdeCreateStringHandle):
* intl-auto-encap-win32.c (qxeAbortSystemShutdown):
* intl-auto-encap-win32.c (qxeRegConnectRegistry):
* intl-auto-encap-win32.c (qxeGetICMProfile):
* intl-auto-encap-win32.h:
Rebuild.
* intl-encap-win32.c:
* intl-encap-win32.c (qxeUpdateICMRegKey):
Delete manual definitions of functions with former errors in
Cygwin headers but no longer. Use "override" with some functions
where Cygwin or VS6 accidentally omits a const declaration or
includes an extra one. Use "no" on SendMessageTimeout, which
has an error in the VS6 prototype (you could manually fix this
with an ifdef to split the Cygwin vs. VS6 calls, if we ever
actually used this function).
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 30 Jan 2010 20:34:23 -0600 |
parents | 49de55c09f18 |
children | 7eec2a1f3412 |
comparison
equal
deleted
inserted
replaced
4902:c902301f8b7d | 4903:70089046adef |
---|---|
140 return DragQueryFileW (arg1, arg2, (LPWSTR) arg3, arg4); | 140 return DragQueryFileW (arg1, arg2, (LPWSTR) arg3, arg4); |
141 else | 141 else |
142 return DragQueryFileA (arg1, arg2, (LPSTR) arg3, arg4); | 142 return DragQueryFileA (arg1, arg2, (LPSTR) arg3, arg4); |
143 } | 143 } |
144 | 144 |
145 /* NOTE: error arg2, Cygwin prototype, extra const. | |
146 NOTE: Prototype manually overridden. | |
147 Header file claims: | |
148 HICON WINAPI ExtractAssociatedIcon(HINSTANCE,LPCWSTR,PWORD) | |
149 Overridden with: | |
150 HICON ExtractAssociatedIcon(HINSTANCE, LPWSTR, LPWORD) | |
151 Differences in return-type qualifiers, e.g. WINAPI, are not important. | |
152 */ | |
145 HICON | 153 HICON |
146 qxeExtractAssociatedIcon (HINSTANCE arg1, const Extbyte * arg2, PWORD arg3) | 154 qxeExtractAssociatedIcon (HINSTANCE arg1, Extbyte * arg2, LPWORD arg3) |
147 { | 155 { |
148 if (XEUNICODE_P) | 156 if (XEUNICODE_P) |
149 return ExtractAssociatedIconW (arg1, (LPCWSTR) arg2, arg3); | 157 return ExtractAssociatedIconW (arg1, (LPWSTR) arg2, arg3); |
150 else | 158 else |
151 return ExtractAssociatedIconA (arg1, (LPCSTR) arg2, arg3); | 159 return ExtractAssociatedIconA (arg1, (LPSTR) arg2, arg3); |
152 } | 160 } |
153 | 161 |
154 HICON | 162 HICON |
155 qxeExtractIcon (HINSTANCE arg1, const Extbyte * arg2, UINT arg3) | 163 qxeExtractIcon (HINSTANCE arg1, const Extbyte * arg2, UINT arg3) |
156 { | 164 { |
158 return ExtractIconW (arg1, (LPCWSTR) arg2, arg3); | 166 return ExtractIconW (arg1, (LPCWSTR) arg2, arg3); |
159 else | 167 else |
160 return ExtractIconA (arg1, (LPCSTR) arg2, arg3); | 168 return ExtractIconA (arg1, (LPCSTR) arg2, arg3); |
161 } | 169 } |
162 | 170 |
163 /* Skipping ExtractIconEx because NT 4.0+ only, error in Cygwin prototype */ | 171 /* NOTE: NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10) */ |
172 UINT | |
173 qxeExtractIconEx (const Extbyte * arg1, int arg2, HICON* arg3, HICON* arg4, UINT arg5) | |
174 { | |
175 if (XEUNICODE_P) | |
176 return ExtractIconExW ((LPCWSTR) arg1, arg2, arg3, arg4, arg5); | |
177 else | |
178 return ExtractIconExA ((LPCSTR) arg1, arg2, arg3, arg4, arg5); | |
179 } | |
164 | 180 |
165 HINSTANCE | 181 HINSTANCE |
166 qxeFindExecutable (const Extbyte * arg1, const Extbyte * arg2, Extbyte * arg3) | 182 qxeFindExecutable (const Extbyte * arg1, const Extbyte * arg2, Extbyte * arg3) |
167 { | 183 { |
168 if (XEUNICODE_P) | 184 if (XEUNICODE_P) |
924 return CreateDialogParamW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5); | 940 return CreateDialogParamW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5); |
925 else | 941 else |
926 return CreateDialogParamA (arg1, (LPCSTR) arg2, arg3, arg4, arg5); | 942 return CreateDialogParamA (arg1, (LPCSTR) arg2, arg3, arg4, arg5); |
927 } | 943 } |
928 | 944 |
945 /* NOTE: error arg 1, VS6 prototype, missing const. | |
946 NOTE: Prototype manually overridden. | |
947 Header file claims: | |
948 WINUSERAPI HWND WINAPI CreateMDIWindow(LPCWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM) | |
949 Overridden with: | |
950 HWND CreateMDIWindow(LPWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM) | |
951 Differences in return-type qualifiers, e.g. WINAPI, are not important. | |
952 */ | |
929 HWND | 953 HWND |
930 qxeCreateMDIWindow (const Extbyte * arg1, const Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10) | 954 qxeCreateMDIWindow (Extbyte * arg1, const Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10) |
931 { | 955 { |
932 if (XEUNICODE_P) | 956 if (XEUNICODE_P) |
933 return CreateMDIWindowW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); | 957 return CreateMDIWindowW ((LPWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); |
934 else | 958 else |
935 return CreateMDIWindowA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); | 959 return CreateMDIWindowA ((LPSTR) arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); |
936 } | 960 } |
937 | 961 |
938 HWND | 962 HWND |
939 qxeCreateWindowEx (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, DWORD arg4, int arg5, int arg6, int arg7, int arg8, HWND arg9, HMENU arg10, HINSTANCE arg11, LPVOID arg12) | 963 qxeCreateWindowEx (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, DWORD arg4, int arg5, int arg6, int arg7, int arg8, HWND arg9, HMENU arg10, HINSTANCE arg11, LPVOID arg12) |
940 { | 964 { |
942 return CreateWindowExW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); | 966 return CreateWindowExW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); |
943 else | 967 else |
944 return CreateWindowExA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); | 968 return CreateWindowExA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); |
945 } | 969 } |
946 | 970 |
971 /* NOTE: error arg 1, VS6 prototype, missing const. | |
972 NOTE: Prototype manually overridden. | |
973 Header file claims: | |
974 WINUSERAPI HWINSTA WINAPI CreateWindowStation(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES) | |
975 Overridden with: | |
976 HWINSTA CreateWindowStation(LPWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES) | |
977 Differences in return-type qualifiers, e.g. WINAPI, are not important. | |
978 */ | |
947 HWINSTA | 979 HWINSTA |
948 qxeCreateWindowStation (const Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4) | 980 qxeCreateWindowStation (Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4) |
949 { | 981 { |
950 if (XEUNICODE_P) | 982 if (XEUNICODE_P) |
951 return CreateWindowStationW ((LPCWSTR) arg1, arg2, arg3, arg4); | 983 return CreateWindowStationW ((LPWSTR) arg1, arg2, arg3, arg4); |
952 else | 984 else |
953 return CreateWindowStationA ((LPCSTR) arg1, arg2, arg3, arg4); | 985 return CreateWindowStationA ((LPSTR) arg1, arg2, arg3, arg4); |
954 } | 986 } |
955 | 987 |
956 /* Error if DefDlgProc used: return value is conditionalized on _MAC, messes up parser */ | 988 /* Error if DefDlgProc used: return value is conditionalized on _MAC, messes up parser */ |
957 | 989 |
958 LRESULT | 990 LRESULT |
1591 return SendMessageCallbackW (arg1, arg2, arg3, arg4, arg5, arg6); | 1623 return SendMessageCallbackW (arg1, arg2, arg3, arg4, arg5, arg6); |
1592 else | 1624 else |
1593 return SendMessageCallbackA (arg1, arg2, arg3, arg4, arg5, arg6); | 1625 return SendMessageCallbackA (arg1, arg2, arg3, arg4, arg5, arg6); |
1594 } | 1626 } |
1595 | 1627 |
1596 LRESULT | 1628 /* Error if SendMessageTimeout used: VS6 has erroneous seventh parameter DWORD_PTR instead of PDWORD_PTR */ |
1597 qxeSendMessageTimeout (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4, UINT arg5, UINT arg6, PDWORD_PTR arg7) | |
1598 { | |
1599 if (XEUNICODE_P) | |
1600 return SendMessageTimeoutW (arg1, arg2, arg3, arg4, arg5, arg6, arg7); | |
1601 else | |
1602 return SendMessageTimeoutA (arg1, arg2, arg3, arg4, arg5, arg6, arg7); | |
1603 } | |
1604 | 1629 |
1605 /* Skipping SendMessage because split messages and structures */ | 1630 /* Skipping SendMessage because split messages and structures */ |
1606 | 1631 |
1607 BOOL | 1632 BOOL |
1608 qxeSendNotifyMessage (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4) | 1633 qxeSendNotifyMessage (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4) |
1747 | 1772 |
1748 /*----------------------------------------------------------------------*/ | 1773 /*----------------------------------------------------------------------*/ |
1749 /* Processing file DDEML.H */ | 1774 /* Processing file DDEML.H */ |
1750 /*----------------------------------------------------------------------*/ | 1775 /*----------------------------------------------------------------------*/ |
1751 | 1776 |
1752 /* Skipping DdeCreateStringHandle because error in Cygwin prototype */ | 1777 /* NOTE: former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10) */ |
1778 HSZ | |
1779 qxeDdeCreateStringHandle (DWORD arg1, const Extbyte * arg2, int arg3) | |
1780 { | |
1781 if (XEUNICODE_P) | |
1782 return DdeCreateStringHandleW (arg1, (LPCWSTR) arg2, arg3); | |
1783 else | |
1784 return DdeCreateStringHandleA (arg1, (LPCSTR) arg2, arg3); | |
1785 } | |
1753 | 1786 |
1754 UINT | 1787 UINT |
1755 qxeDdeInitialize (PDWORD arg1, PFNCALLBACK arg2, DWORD arg3, DWORD arg4) | 1788 qxeDdeInitialize (PDWORD arg1, PFNCALLBACK arg2, DWORD arg3, DWORD arg4) |
1756 { | 1789 { |
1757 if (XEUNICODE_P) | 1790 if (XEUNICODE_P) |
1772 | 1805 |
1773 /*----------------------------------------------------------------------*/ | 1806 /*----------------------------------------------------------------------*/ |
1774 /* Processing file WINREG.H */ | 1807 /* Processing file WINREG.H */ |
1775 /*----------------------------------------------------------------------*/ | 1808 /*----------------------------------------------------------------------*/ |
1776 | 1809 |
1777 BOOL | 1810 /* NOTE: error arg 1, Cygwin prototype, extra const. |
1778 qxeAbortSystemShutdown (const Extbyte * arg1) | 1811 NOTE: Prototype manually overridden. |
1779 { | 1812 Header file claims: |
1780 if (XEUNICODE_P) | 1813 WINADVAPI BOOL WINAPI AbortSystemShutdown(LPCWSTR) |
1781 return AbortSystemShutdownW ((LPCWSTR) arg1); | 1814 Overridden with: |
1782 else | 1815 BOOL AbortSystemShutdown(LPWSTR) |
1783 return AbortSystemShutdownA ((LPCSTR) arg1); | 1816 Differences in return-type qualifiers, e.g. WINAPI, are not important. |
1817 */ | |
1818 BOOL | |
1819 qxeAbortSystemShutdown (Extbyte * arg1) | |
1820 { | |
1821 if (XEUNICODE_P) | |
1822 return AbortSystemShutdownW ((LPWSTR) arg1); | |
1823 else | |
1824 return AbortSystemShutdownA ((LPSTR) arg1); | |
1784 } | 1825 } |
1785 | 1826 |
1786 BOOL | 1827 BOOL |
1787 qxeInitiateSystemShutdown (Extbyte * arg1, Extbyte * arg2, DWORD arg3, BOOL arg4, BOOL arg5) | 1828 qxeInitiateSystemShutdown (Extbyte * arg1, Extbyte * arg2, DWORD arg3, BOOL arg4, BOOL arg5) |
1788 { | 1829 { |
1790 return InitiateSystemShutdownW ((LPWSTR) arg1, (LPWSTR) arg2, arg3, arg4, arg5); | 1831 return InitiateSystemShutdownW ((LPWSTR) arg1, (LPWSTR) arg2, arg3, arg4, arg5); |
1791 else | 1832 else |
1792 return InitiateSystemShutdownA ((LPSTR) arg1, (LPSTR) arg2, arg3, arg4, arg5); | 1833 return InitiateSystemShutdownA ((LPSTR) arg1, (LPSTR) arg2, arg3, arg4, arg5); |
1793 } | 1834 } |
1794 | 1835 |
1795 /* Skipping RegConnectRegistry because error in Cygwin prototype */ | 1836 /* NOTE: former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10) */ |
1837 LONG | |
1838 qxeRegConnectRegistry (const Extbyte * arg1, HKEY arg2, PHKEY arg3) | |
1839 { | |
1840 if (XEUNICODE_P) | |
1841 return RegConnectRegistryW ((LPCWSTR) arg1, arg2, arg3); | |
1842 else | |
1843 return RegConnectRegistryA ((LPCSTR) arg1, arg2, arg3); | |
1844 } | |
1796 | 1845 |
1797 LONG | 1846 LONG |
1798 qxeRegCreateKeyEx (HKEY arg1, const Extbyte * arg2, DWORD arg3, Extbyte * arg4, DWORD arg5, REGSAM arg6, LPSECURITY_ATTRIBUTES arg7, PHKEY arg8, PDWORD arg9) | 1847 qxeRegCreateKeyEx (HKEY arg1, const Extbyte * arg2, DWORD arg3, Extbyte * arg4, DWORD arg5, REGSAM arg6, LPSECURITY_ATTRIBUTES arg7, PHKEY arg8, PDWORD arg9) |
1799 { | 1848 { |
1800 if (XEUNICODE_P) | 1849 if (XEUNICODE_P) |
2340 | 2389 |
2341 #endif /* defined (HAVE_MS_WINDOWS) */ | 2390 #endif /* defined (HAVE_MS_WINDOWS) */ |
2342 | 2391 |
2343 #if defined (HAVE_MS_WINDOWS) | 2392 #if defined (HAVE_MS_WINDOWS) |
2344 | 2393 |
2345 /* Skipping GetICMProfile because NT 4.0+ only, error in Cygwin prototype */ | 2394 /* NOTE: NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10) */ |
2395 BOOL | |
2396 qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3) | |
2397 { | |
2398 if (XEUNICODE_P) | |
2399 return GetICMProfileW (arg1, arg2, (LPWSTR) arg3); | |
2400 else | |
2401 return GetICMProfileA (arg1, arg2, (LPSTR) arg3); | |
2402 } | |
2346 | 2403 |
2347 #endif /* defined (HAVE_MS_WINDOWS) */ | 2404 #endif /* defined (HAVE_MS_WINDOWS) */ |
2348 | 2405 |
2349 #if defined (HAVE_MS_WINDOWS) | 2406 #if defined (HAVE_MS_WINDOWS) |
2350 | 2407 |