Skip to content

Commit 3c0ea55

Browse files
committed
Add winapi LOAD_* constants
1 parent 2c5eba7 commit 3c0ea55

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PosixConstants.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ public final class PosixConstants {
190190
public static final MandatoryIntConstant RTLD_NOW;
191191
public static final MandatoryIntConstant RTLD_GLOBAL;
192192
public static final MandatoryIntConstant RTLD_LOCAL;
193+
public static final OptionalIntConstant LOAD_LIBRARY_SEARCH_DEFAULT_DIRS;
194+
public static final OptionalIntConstant LOAD_LIBRARY_SEARCH_APPLICATION_DIR;
195+
public static final OptionalIntConstant LOAD_LIBRARY_SEARCH_SYSTEM32;
196+
public static final OptionalIntConstant LOAD_LIBRARY_SEARCH_USER_DIRS;
197+
public static final OptionalIntConstant LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR;
193198
public static final MandatoryIntConstant AF_UNSPEC;
194199
public static final MandatoryIntConstant AF_INET;
195200
public static final MandatoryIntConstant AF_INET6;
@@ -377,6 +382,7 @@ public final class PosixConstants {
377382
public static final IntConstant[] accessMode;
378383
public static final IntConstant[] exitStatus;
379384
public static final IntConstant[] rtld;
385+
public static final IntConstant[] winapiLoadLibraryFlags;
380386
public static final IntConstant[] socketFamily;
381387
public static final IntConstant[] socketType;
382388
public static final IntConstant[] ip4Address;
@@ -506,6 +512,11 @@ public final class PosixConstants {
506512
RTLD_NOW = reg.createMandatoryInt("RTLD_NOW");
507513
RTLD_GLOBAL = reg.createMandatoryInt("RTLD_GLOBAL");
508514
RTLD_LOCAL = reg.createMandatoryInt("RTLD_LOCAL");
515+
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = reg.createOptionalInt("LOAD_LIBRARY_SEARCH_DEFAULT_DIRS");
516+
LOAD_LIBRARY_SEARCH_APPLICATION_DIR = reg.createOptionalInt("LOAD_LIBRARY_SEARCH_APPLICATION_DIR");
517+
LOAD_LIBRARY_SEARCH_SYSTEM32 = reg.createOptionalInt("LOAD_LIBRARY_SEARCH_SYSTEM32");
518+
LOAD_LIBRARY_SEARCH_USER_DIRS = reg.createOptionalInt("LOAD_LIBRARY_SEARCH_USER_DIRS");
519+
LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = reg.createOptionalInt("LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR");
509520
AF_UNSPEC = reg.createMandatoryInt("AF_UNSPEC");
510521
AF_INET = reg.createMandatoryInt("AF_INET");
511522
AF_INET6 = reg.createMandatoryInt("AF_INET6");
@@ -695,6 +706,8 @@ public final class PosixConstants {
695706
exitStatus = new IntConstant[]{EX_OK, EX_USAGE, EX_DATAERR, EX_NOINPUT, EX_NOUSER, EX_NOHOST, EX_UNAVAILABLE, EX_SOFTWARE, EX_OSERR, EX_OSFILE, EX_CANTCREAT, EX_IOERR, EX_TEMPFAIL,
696707
EX_PROTOCOL, EX_NOPERM, EX_CONFIG, EX_NOTFOUND};
697708
rtld = new IntConstant[]{RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, RTLD_LOCAL};
709+
winapiLoadLibraryFlags = new IntConstant[]{LOAD_LIBRARY_SEARCH_DEFAULT_DIRS, LOAD_LIBRARY_SEARCH_APPLICATION_DIR, LOAD_LIBRARY_SEARCH_SYSTEM32, LOAD_LIBRARY_SEARCH_USER_DIRS,
710+
LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR};
698711
socketFamily = new IntConstant[]{AF_UNSPEC, AF_INET, AF_INET6, AF_PACKET, AF_UNIX};
699712
socketType = new IntConstant[]{SOCK_DGRAM, SOCK_STREAM};
700713
ip4Address = new IntConstant[]{INADDR_ANY, INADDR_BROADCAST, INADDR_NONE, INADDR_LOOPBACK, INADDR_ALLHOSTS_GROUP, INADDR_MAX_LOCAL_GROUP, INADDR_UNSPEC_GROUP};

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PosixConstantsWin32.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
*/
4141
package com.oracle.graal.python.runtime;
4242

43-
// Auto generated by gen_native_cfg.py at 2024-12-11 11:43:19.772900
44-
// on Windows FrankTheTank 11 10.0.22631 AMD64 Intel64 Family 6 Model 186 Stepping 2, GenuineIntel
43+
// Auto generated by gen_native_cfg.py at 2025-08-19 12:47:42.927963
44+
// on Windows QUICKEM-GVMHCD3 11 10.0.22631 AMD64 Intel64 Family 6 Model 154 Stepping 3, GenuineIntel
4545
class PosixConstantsWin32 {
4646

4747
private PosixConstantsWin32() {
@@ -114,6 +114,11 @@ static void getConstants(PosixConstants.Registry constants) {
114114
constants.put("RTLD_NOW", 0);
115115
constants.put("RTLD_GLOBAL", 0);
116116
constants.put("RTLD_LOCAL", 0);
117+
constants.put("LOAD_LIBRARY_SEARCH_DEFAULT_DIRS", 4096);
118+
constants.put("LOAD_LIBRARY_SEARCH_APPLICATION_DIR", 512);
119+
constants.put("LOAD_LIBRARY_SEARCH_SYSTEM32", 2048);
120+
constants.put("LOAD_LIBRARY_SEARCH_USER_DIRS", 1024);
121+
constants.put("LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR", 256);
117122
constants.put("AF_UNSPEC", 0);
118123
constants.put("AF_INET", 2);
119124
constants.put("AF_INET6", 23);

scripts/gen_native_cfg.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,13 @@
266266
0 x RTLD_GLOBAL
267267
0 x RTLD_LOCAL
268268
269+
[winapiLoadLibraryFlags]
270+
* i LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
271+
* i LOAD_LIBRARY_SEARCH_APPLICATION_DIR
272+
* i LOAD_LIBRARY_SEARCH_SYSTEM32
273+
* i LOAD_LIBRARY_SEARCH_USER_DIRS
274+
* i LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
275+
269276
[socketFamily]
270277
i AF_UNSPEC
271278
i AF_INET

0 commit comments

Comments
 (0)