Skip to content

Commit bbe1b4f

Browse files
committed
regenerate posix constants for windows
1 parent ece116c commit bbe1b4f

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public final class PosixConstants {
114114
public static final OptionalIntConstant O_DIRECT;
115115
public static final OptionalIntConstant O_RSYNC;
116116
public static final OptionalIntConstant O_TMPFILE;
117+
public static final OptionalIntConstant O_TEMPORARY;
117118
public static final OptionalIntConstant O_DIRECTORY;
118119
public static final OptionalIntConstant O_BINARY;
119120
public static final OptionalIntConstant O_TEXT;
@@ -406,6 +407,7 @@ public final class PosixConstants {
406407
O_DIRECT = reg.createOptionalInt("O_DIRECT");
407408
O_RSYNC = reg.createOptionalInt("O_RSYNC");
408409
O_TMPFILE = reg.createOptionalInt("O_TMPFILE");
410+
O_TEMPORARY = reg.createOptionalInt("O_TEMPORARY");
409411
O_DIRECTORY = reg.createOptionalInt("O_DIRECTORY");
410412
O_BINARY = reg.createOptionalInt("O_BINARY");
411413
O_TEXT = reg.createOptionalInt("O_TEXT");
@@ -636,7 +638,7 @@ public final class PosixConstants {
636638
SIZEOF_STRUCT_SOCKADDR_UN_SUN_PATH = reg.createMandatoryInt("SIZEOF_STRUCT_SOCKADDR_UN_SUN_PATH");
637639

638640
openFlags = new IntConstant[]{O_ACCMODE, O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_TRUNC, O_APPEND, O_NONBLOCK, O_NOCTTY, O_NDELAY, O_DSYNC, O_CLOEXEC, O_SYNC, O_DIRECT, O_RSYNC,
639-
O_TMPFILE, O_DIRECTORY, O_BINARY, O_TEXT, O_XATTR, O_LARGEFILE, O_SHLOCK, O_EXLOCK, O_EXEC, O_SEARCH, O_PATH, O_TTY_INIT};
641+
O_TMPFILE, O_TEMPORARY, O_DIRECTORY, O_BINARY, O_TEXT, O_XATTR, O_LARGEFILE, O_SHLOCK, O_EXLOCK, O_EXEC, O_SEARCH, O_PATH, O_TTY_INIT};
640642
fileType = new IntConstant[]{S_IFMT, S_IFSOCK, S_IFLNK, S_IFREG, S_IFBLK, S_IFDIR, S_IFCHR, S_IFIFO};
641643
mmapFlags = new IntConstant[]{MAP_SHARED, MAP_PRIVATE, MAP_ANONYMOUS, MAP_DENYWRITE, MAP_EXECUTABLE};
642644
mmapProtection = new IntConstant[]{PROT_NONE, PROT_READ, PROT_WRITE, PROT_EXEC};

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

Lines changed: 21 additions & 9 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 2022-10-17 20:47:43.917067
44-
// on Windows DESKTOP-UOQCHD2 10 10.0.22000 AMD64 Intel64 Family 6 Model 165 Stepping 2, GenuineIntel
43+
// Auto generated by gen_native_cfg.py at 2023-07-06 09:43:02.003004
44+
// on Windows DESKTOP-UOQCHD2 10 10.0.22621 AMD64 Intel64 Family 6 Model 165 Stepping 2, GenuineIntel
4545
class PosixConstantsWin32 {
4646

4747
private PosixConstantsWin32() {
@@ -65,19 +65,16 @@ static void getConstants(PosixConstants.Registry constants) {
6565
constants.put("SEEK_CUR", 1);
6666
constants.put("SEEK_END", 2);
6767
constants.put("SOMAXCONN", 2147483647);
68-
constants.put("O_ACCMODE", 0);
6968
constants.put("O_RDONLY", 0x00000000);
7069
constants.put("O_WRONLY", 0x00000001);
7170
constants.put("O_RDWR", 0x00000002);
7271
constants.put("O_CREAT", 0x00000100);
7372
constants.put("O_EXCL", 0x00000400);
7473
constants.put("O_TRUNC", 0x00000200);
7574
constants.put("O_APPEND", 0x00000008);
76-
constants.put("O_NONBLOCK", 0);
77-
constants.put("O_NDELAY", 0);
78-
constants.put("O_DSYNC", 0);
79-
constants.put("O_CLOEXEC", 0);
80-
constants.put("O_SYNC", 0);
75+
constants.put("O_TEMPORARY", 0x00000040);
76+
constants.put("O_BINARY", 0x00008000);
77+
constants.put("O_TEXT", 0x00004000);
8178
constants.put("S_IFMT", 0x0000F000);
8279
constants.put("S_IFSOCK", 0);
8380
constants.put("S_IFLNK", 0);
@@ -112,7 +109,6 @@ static void getConstants(PosixConstants.Registry constants) {
112109
constants.put("W_OK", 0);
113110
constants.put("X_OK", 0);
114111
constants.put("F_OK", 0);
115-
constants.put("EX_OK", 0);
116112
constants.put("RTLD_LAZY", 0);
117113
constants.put("RTLD_NOW", 0);
118114
constants.put("RTLD_GLOBAL", 0);
@@ -202,6 +198,22 @@ static void getConstants(PosixConstants.Registry constants) {
202198
constants.put("TCP_KEEPINTVL", 17);
203199
constants.put("TCP_KEEPCNT", 16);
204200
constants.put("TCP_FASTOPEN", 15);
201+
constants.put("IPV6_JOIN_GROUP", 12);
202+
constants.put("IPV6_LEAVE_GROUP", 13);
203+
constants.put("IPV6_MULTICAST_HOPS", 10);
204+
constants.put("IPV6_MULTICAST_IF", 9);
205+
constants.put("IPV6_MULTICAST_LOOP", 11);
206+
constants.put("IPV6_UNICAST_HOPS", 4);
207+
constants.put("IPV6_V6ONLY", 27);
208+
constants.put("IPV6_CHECKSUM", 26);
209+
constants.put("IPV6_DONTFRAG", 14);
210+
constants.put("IPV6_HOPLIMIT", 21);
211+
constants.put("IPV6_HOPOPTS", 1);
212+
constants.put("IPV6_PKTINFO", 19);
213+
constants.put("IPV6_RECVRTHDR", 38);
214+
constants.put("IPV6_RECVTCLASS", 40);
215+
constants.put("IPV6_RTHDR", 32);
216+
constants.put("IPV6_TCLASS", 39);
205217
constants.put("SIZEOF_STRUCT_SOCKADDR_STORAGE", 128);
206218
constants.put("SIZEOF_STRUCT_SOCKADDR_IN", 16);
207219
constants.put("OFFSETOF_STRUCT_SOCKADDR_IN_SIN_FAMILY", 0);

scripts/gen_native_cfg.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
# include <sys/unistd.h>
7777
# include <sys/utsname.h>
7878
# include <sys/wait.h>
79+
# include <sysexits.h>
7980
#else
8081
# include <winsock2.h>
8182
# include <ws2tcpip.h>
@@ -90,7 +91,6 @@
9091
#include <limits.h>
9192
#include <stddef.h>
9293
#include <stdio.h>
93-
#include <sysexits.h>
9494
#include <sys/types.h>
9595
'''
9696

@@ -159,6 +159,7 @@
159159
* x O_DIRECT
160160
* x O_RSYNC
161161
* x O_TMPFILE
162+
* x O_TEMPORARY
162163
* x O_DIRECTORY
163164
* x O_BINARY
164165
* x O_TEXT
@@ -609,8 +610,9 @@ def generate_platform():
609610
f.write(' return 0;\n}\n')
610611

611612
flags = '-D_GNU_SOURCE' if platform == 'Linux' else ''
613+
flags += '' if platform == 'Win32' else ' -Wall -Werror -Wno-format '
612614
cc = os.environ.get('CC', 'cc')
613-
subprocess.run(f'{cc} -Wall -Werror -Wno-format {flags} -o {c_executable_file} {c_source_file}', shell=True, check=True)
615+
subprocess.run(f'{cc} {flags} -o {c_executable_file} {c_source_file}', shell=True, check=True)
614616

615617
output = subprocess.run(f'./{c_executable_file}', shell=False, check=True, stdout=subprocess.PIPE, universal_newlines=True).stdout[:-1]
616618
uname = " ".join(tuple(plat.uname()))

0 commit comments

Comments
 (0)