ObjFW  Diff

Differences From Artifact [aaab12c640]:

To Artifact [752c197aa2]:


89
90
91
92
93
94
95



96
97
98
99
100
101
102
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105







+
+
+







# include <windows.h>
# include <direct.h>
#endif

#ifndef O_BINARY
# define O_BINARY 0
#endif
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
#endif
#ifndef O_EXLOCK
# define O_EXLOCK 0
#endif

#ifndef S_IRGRP
# define S_IRGRP 0
#endif
886
887
888
889
890
891
892


893
894
895
896
897
898
899
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904







+
+







	self = [super init];

	@try {
		int flags;

		if ((flags = parseMode([mode UTF8String])) == -1)
			@throw [OFInvalidArgumentException exception];

		flags |= O_CLOEXEC;

#ifndef _WIN32
		if ((_fd = open([path cStringWithEncoding: [OFSystemInfo
		    native8BitEncoding]], flags, DEFAULT_MODE)) == -1)
#else
		if ((_fd = _wopen([path UTF16String], flags,
		    DEFAULT_MODE)) == -1)