Skip to content

Commit 8737773

Browse files
committed
inc: Partially update fbfrog-based bindings with missing #defines
backporting some of the changes from commit 558254a, but not all, because the 1.02 compiler doesn't allow redundant Consts yet. Thus only the ones reported on the forum (lstrcpy/lstrcat) and some others that seem useful. Conflicts: changelog.txt inc/win/ntddndis.bi inc/win/pciprop.bi
1 parent 57b4eef commit 8737773

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Version 1.02.1
1313
- 1.02.0 regression: OpenGL binding: glGetString() and some others use ZString Ptr instead of GLubyte Ptr again
1414
- 1.02.0 regression: Windows API binding: REFIID and some other REF* types were missing; wsprintf/wvsprintf declarations were missing; ole2.bi couldn't be included directly/alone anymore.
1515
- bindings: Various previously untranslated (or wrongly translated) #defines in SDL2, X11, crt/pthread, Windows API
16-
- Windows API binding: DirectX headers missed some declarations and some didn't compile, win/commdlg.bi couldn't be #included behind windows.bi without WIN_INCLUDEALL because of missing #includes; re-added the undocumented ENUMWINDOWSPROC type; shlwapi.bi #includes shlobj.bi again (for backwards compatibility).
16+
- Windows API binding: DirectX headers missed some declarations and some didn't compile, win/commdlg.bi couldn't be #included behind windows.bi without WIN_INCLUDEALL because of missing #includes; re-added the undocumented ENUMWINDOWSPROC type; shlwapi.bi #includes shlobj.bi again (for backwards compatibility), some #defines were missing (e.g. lstrcpy/lstrcat).
1717
- crt/string.bi, crt/mem.bi: Added CONSTs to function declarations
1818
- #767: Illegal byref result assignments will now cause a proper error message, not just a warning
1919
- Using the -asm att|intel option for non-x86[_64] targets now triggers an error

inc/win/shlwapi.bi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ declare function SHLoadIndirectString(byval pszSource as LPCWSTR, byval pszOutBu
163163
#define StrIntlEqNI StrIntlEqNIW
164164
#define StrFormatByteSize StrFormatByteSizeW
165165
#define StrFormatKBSize StrFormatKBSizeW
166+
#define StrNCat StrNCatW
166167
#define StrTrim StrTrimW
168+
#define StrCatBuff StrCatBuffW
167169
#define ChrCmpI ChrCmpIW
168170
#define wvnsprintf wvnsprintfW
169171
#define wnsprintf wnsprintfW
@@ -202,7 +204,9 @@ declare function SHLoadIndirectString(byval pszSource as LPCWSTR, byval pszOutBu
202204
#define StrIntlEqNI StrIntlEqNIA
203205
#define StrFormatByteSize StrFormatByteSizeA
204206
#define StrFormatKBSize StrFormatKBSizeA
207+
#define StrNCat StrNCatA
205208
#define StrTrim StrTrimA
209+
#define StrCatBuff StrCatBuffA
206210
#define ChrCmpI ChrCmpIA
207211
#define wvnsprintf wvnsprintfA
208212
#define wnsprintf wnsprintfA
@@ -242,23 +246,30 @@ declare function IntlStrEqWorkerW(byval fCaseSens as WINBOOL, byval lpString1 as
242246
#define PathIsHTMLFileW(pszPath) PathIsContentTypeW(pszPath, SZ_CONTENTTYPE_HTMLW)
243247
#define STIF_DEFAULT __MSABI_LONG(&h00000000)
244248
#define STIF_SUPPORT_HEX __MSABI_LONG(&h00000001)
249+
#define StrCatA lstrcatA
245250
#define StrCmpA lstrcmpA
246251
#define StrCmpIA lstrcmpiA
252+
#define StrCpyA lstrcpyA
247253
#define StrCpyNA lstrcpynA
248254
#define StrToLong StrToInt
249255
#define StrNCmp StrCmpN
250256
#define StrNCmpI StrCmpNI
251257
#define StrNCpy StrCpyN
258+
#define StrCatN StrNCat
252259

253260
#ifdef UNICODE
254261
#define StrCatBuff StrCatBuffW
262+
#define StrCat StrCatW
255263
#define StrCmp StrCmpW
256264
#define StrCmpI StrCmpIW
265+
#define StrCpy StrCpyW
257266
#define StrCpyN StrCpyNW
258267
#else
259268
#define StrCatBuff StrCatBuffA
269+
#define StrCat lstrcatA
260270
#define StrCmp lstrcmpA
261271
#define StrCmpI lstrcmpiA
272+
#define StrCpy lstrcpyA
262273
#define StrCpyN lstrcpynA
263274
#endif
264275

@@ -1096,9 +1107,11 @@ declare function AssocQueryKeyW(byval flags as ASSOCF, byval key as ASSOCKEY, by
10961107
#endif
10971108

10981109
#ifdef UNICODE
1110+
#define SHOpenRegStream SHOpenRegStreamW
10991111
#define SHOpenRegStream2 SHOpenRegStream2W
11001112
#define SHCreateStreamOnFile SHCreateStreamOnFileW
11011113
#else
1114+
#define SHOpenRegStream SHOpenRegStreamA
11021115
#define SHOpenRegStream2 SHOpenRegStream2A
11031116
#define SHCreateStreamOnFile SHCreateStreamOnFileA
11041117
#endif
@@ -1107,6 +1120,7 @@ declare function SHOpenRegStreamA(byval hkey as HKEY, byval pszSubkey as LPCSTR,
11071120
declare function SHOpenRegStreamW(byval hkey as HKEY, byval pszSubkey as LPCWSTR, byval pszValue as LPCWSTR, byval grfMode as DWORD) as IStream ptr
11081121
declare function SHOpenRegStream2A(byval hkey as HKEY, byval pszSubkey as LPCSTR, byval pszValue as LPCSTR, byval grfMode as DWORD) as IStream ptr
11091122
declare function SHOpenRegStream2W(byval hkey as HKEY, byval pszSubkey as LPCWSTR, byval pszValue as LPCWSTR, byval grfMode as DWORD) as IStream ptr
1123+
#undef SHOpenRegStream
11101124
#define SHOpenRegStream SHOpenRegStream2
11111125
declare function SHCreateStreamOnFileA(byval pszFile as LPCSTR, byval grfMode as DWORD, byval ppstm as IStream ptr ptr) as HRESULT
11121126
declare function SHCreateStreamOnFileW(byval pszFile as LPCWSTR, byval grfMode as DWORD, byval ppstm as IStream ptr ptr) as HRESULT

inc/win/winbase.bi

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -857,13 +857,15 @@ declare function GetModuleHandleExW(byval dwFlags as DWORD, byval lpModuleName a
857857
#define GetModuleFileName GetModuleFileNameW
858858
#define GetModuleHandle GetModuleHandleW
859859
#define LoadLibraryEx LoadLibraryExW
860+
#define EnumResourceLanguages EnumResourceLanguagesW
860861
#else
861862
#define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXA
862863
#define GetModuleHandleEx GetModuleHandleExA
863864
#define LoadString LoadStringA
864865
#define GetModuleFileName GetModuleFileNameA
865866
#define GetModuleHandle GetModuleHandleA
866867
#define LoadLibraryEx LoadLibraryExA
868+
#define EnumResourceLanguages EnumResourceLanguagesA
867869
#endif
868870

869871
#if _WIN32_WINNT = &h0602
@@ -2355,20 +2357,25 @@ type POFSTRUCT as _OFSTRUCT ptr
23552357
end function
23562358

23572359
#define InterlockedCompareExchangePointer(Destination, ExChange, Comperand) cast(PVOID, cast(LONG_PTR, InterlockedCompareExchange(cptr(LONG ptr, (Destination)), cast(LONG, cast(LONG_PTR, (ExChange))), cast(LONG, cast(LONG_PTR, (Comperand))))))
2358-
#define InterlockedDecrementAcquire InterlockedDecrement
2359-
#define InterlockedDecrementRelease InterlockedDecrement
23602360
#endif
23612361

23622362
#define InterlockedIncrementAcquire InterlockedIncrement
23632363
#define InterlockedIncrementRelease InterlockedIncrement
23642364

23652365
#ifdef __FB_64BIT__
23662366
#define InterlockedDecrement _InterlockedDecrement
2367-
#define InterlockedDecrementAcquire InterlockedDecrement
2368-
#define InterlockedDecrementRelease InterlockedDecrement
2367+
#endif
2368+
2369+
#define InterlockedDecrementAcquire InterlockedDecrement
2370+
#define InterlockedDecrementRelease InterlockedDecrement
2371+
2372+
#ifdef __FB_64BIT__
23692373
#define InterlockedExchange _InterlockedExchange
23702374
#define InterlockedExchangeAdd _InterlockedExchangeAdd
23712375
#define InterlockedCompareExchange _InterlockedCompareExchange
2376+
#else
2377+
#define InterlockedIncrementAcquire InterlockedIncrement
2378+
#define InterlockedIncrementRelease InterlockedIncrement
23722379
#endif
23732380

23742381
#define InterlockedCompareExchangeAcquire InterlockedCompareExchange
@@ -2753,6 +2760,8 @@ declare function BackupWrite(byval hFile as HANDLE, byval lpBuffer as LPBYTE, by
27532760
#define lstrcmp lstrcmpW
27542761
#define lstrcmpi lstrcmpiW
27552762
#define lstrcpyn lstrcpynW
2763+
#define lstrcpy lstrcpyW
2764+
#define lstrcat lstrcatW
27562765
#define lstrlen lstrlenW
27572766
#else
27582767
#define CreateMailslot CreateMailslotA
@@ -2763,6 +2772,8 @@ declare function BackupWrite(byval hFile as HANDLE, byval lpBuffer as LPBYTE, by
27632772
#define lstrcmp lstrcmpA
27642773
#define lstrcmpi lstrcmpiA
27652774
#define lstrcpyn lstrcpynA
2775+
#define lstrcpy lstrcpyA
2776+
#define lstrcat lstrcatA
27662777
#define lstrlen lstrlenA
27672778
#endif
27682779

@@ -4538,6 +4549,7 @@ declare function SetXStateFeaturesMask(byval Context as PCONTEXT, byval FeatureM
45384549

45394550
#define MICROSOFT_WINDOWS_WINBASE_INTERLOCKED_CPLUSPLUS_H_INCLUDED
45404551
#define MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS ((_WIN32_WINNT >= &h0502) orelse (defined(_WINBASE_) = 0))
4552+
#undef MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS
45414553
const MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS = 0
45424554

45434555
end extern

0 commit comments

Comments
 (0)