ObjFW  Check-in [84caa26d26]

Overview
Comment:Use GetModuleHandle where possible
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 84caa26d26ebd8d3bb8687c2dd6aeb67c01fa60bb25e6aa28917aa5056d8a805
User & Date: js on 2023-10-24 21:12:23
Other Links: manifest | tags
Context
2023-10-24
22:15
OFSystemInfo: Add support for more x86 features check-in: f993c6757b user: js tags: trunk
21:13
Use GetModuleHandle where possible check-in: 1f98847350 user: js tags: 1.0
21:12
Use GetModuleHandle where possible check-in: 84caa26d26 user: js tags: trunk
20:29
OFSystemInfo: Add methods for AVX-512 support check-in: 7899fd79b8 user: js tags: trunk
Changes

Modified src/OFDate.m from [8868a82344] to [223f45375e].

314
315
316
317
318
319
320
321

322
323
324
325
326
327
328
314
315
316
317
318
319
320

321
322
323
324
325
326
327
328







-
+







#if (!defined(HAVE_GMTIME_R) || !defined(HAVE_LOCALTIME_R)) && \
    defined(OF_HAVE_THREADS)
	mutex = [[OFMutex alloc] init];
	atexit(releaseMutex);
#endif

#ifdef OF_WINDOWS
	if ((module = LoadLibrary("msvcrt.dll")) != NULL)
	if ((module = GetModuleHandle("msvcrt.dll")) != NULL)
		_mktime64FuncPtr = (__time64_t (*)(struct tm *))
		    GetProcAddress(module, "_mktime64");
#endif
}

+ (instancetype)alloc
{

Modified src/OFFileIRIHandler.m from [bf82260f3f] to [ff186a2660].

640
641
642
643
644
645
646
647

648
649
650
651

652
653
654
655
656
657
658
640
641
642
643
644
645
646

647
648
649
650

651
652
653
654
655
656
657
658







-
+



-
+







#endif
#if !defined(HAVE_READDIR_R) && !defined(OF_WINDOWS) && defined(OF_HAVE_THREADS)
	readdirMutex = [[OFMutex alloc] init];
	atexit(releaseReaddirMutex);
#endif

#ifdef OF_WINDOWS
	if ((module = LoadLibrary("msvcrt.dll")) != NULL)
	if ((module = GetModuleHandle("msvcrt.dll")) != NULL)
		_wutime64FuncPtr = (int (*)(const wchar_t *,
		    struct __utimbuf64 *))GetProcAddress(module, "_wutime64");

	if ((module = LoadLibrary("kernel32.dll")) != NULL) {
	if ((module = GetModuleHandleA("kernel32.dll")) != NULL) {
		createSymbolicLinkWFuncPtr =
		    (WINAPI BOOLEAN (*)(LPCWSTR, LPCWSTR, DWORD))
		    GetProcAddress(module, "CreateSymbolicLinkW");
		createHardLinkWFuncPtr =
		    (WINAPI BOOLEAN (*)(LPCWSTR, LPCWSTR,
		    LPSECURITY_ATTRIBUTES))
		    GetProcAddress(module, "CreateHardLinkW");

Modified src/platform/Windows/OFSystemInfo+NetworkInterfaces.m from [6f1d4aef92] to [5974874b18].

34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48







-
+







    PIP_ADAPTER_ADDRESSES, PULONG);

static void
init(void)
{
	HMODULE module;

	if ((module = LoadLibrary("iphlpapi.dll")) != NULL)
	if ((module = GetModuleHandle("iphlpapi.dll")) != NULL)
		GetAdaptersAddressesFuncPtr = (WINAPI ULONG (*)(ULONG, ULONG,
		    PVOID, PIP_ADAPTER_ADDRESSES, PULONG))
		    GetProcAddress(module, "GetAdaptersAddresses");

}

static OFMutableDictionary OF_GENERIC(OFString *, OFNetworkInterface) *