Skip to content

Commit 5e02a0c

Browse files
committed
Replace rest of longs with FS_LONGs on Windows
1 parent 3f2de4a commit 5e02a0c

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

FileSystem.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ int FileSystem::GetDents(unsigned int fdNum, struct fs_dirent* dirp, unsigned in
14741474
fs_size_t nameLen = strlen(d.name);
14751475
unsigned short reclen = FS_ALIGN(
14761476
__builtin_offsetof(struct fs_dirent, d_name) + nameLen + 2,
1477-
sizeof(long)
1477+
sizeof(FS_LONG)
14781478
);
14791479
if (nread + reclen > count)
14801480
break;

fsdef.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
#error FileSystem is not available on 32-bit platforms
2626
#else
2727

28+
#ifdef __linux__
29+
#define FS_LONG long
30+
#else
31+
#define FS_LONG long long
32+
#endif
33+
2834
#define FS_AT_EMPTY_PATH 0x1000
2935
#define FS_AT_FDCWD -100
3036
#define FS_AT_REMOVEDIR 0x200
@@ -92,8 +98,8 @@
9298
#define FS_S_IRWXU (FS_S_IRUSR | FS_S_IWUSR | FS_S_IXUSR)
9399
#define FS_S_IRWXG (FS_S_IRWXU >> 3)
94100
#define FS_S_IRWXO (FS_S_IRWXG >> 3)
95-
#define FS_UTIME_NOW ((1l << 30) - 1l)
96-
#define FS_UTIME_OMIT ((1l << 30) - 2l)
101+
#define FS_UTIME_NOW (((FS_LONG)1 << 30) - (FS_LONG)1)
102+
#define FS_UTIME_OMIT (((FS_LONG)1 << 30) - (FS_LONG)2)
97103
#define FS_XATTR_CREATE 0x1
98104
#define FS_XATTR_LIST_MAX 65536
99105
#define FS_XATTR_NAME_MAX 255
@@ -126,12 +132,6 @@
126132

127133
#define FS_IFTODT(mode) ((mode & FS_S_IFMT) >> 12)
128134

129-
#ifdef __linux__
130-
#define FS_LONG long
131-
#else
132-
#define FS_LONG long long
133-
#endif
134-
135135
typedef unsigned FS_LONG fs_dev_t;
136136
typedef unsigned FS_LONG fs_ino_t;
137137
typedef unsigned int fs_mode_t;
@@ -190,6 +190,4 @@ struct fs_utimbuf {
190190
fs_time_t modtime;
191191
};
192192

193-
#undef FS_LONG
194-
195193
#endif

module.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,7 @@ void FileSystemGetCwd(const FunctionCallbackInfo<Value>& args) {
15781578
);
15791579
}
15801580

1581-
void SetTimeProp(Isolate* isolate, Local<Object> obj, const char* prop, fs_time_t sec, long nsec) {
1581+
void SetTimeProp(Isolate* isolate, Local<Object> obj, const char* prop, fs_time_t sec, FS_LONG nsec) {
15821582
Local<Context> context = isolate->GetCurrentContext();
15831583
Local<Object> tim = Object::New(isolate);
15841584
tim->Set(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@daisydogs07/filesystem",
3-
"version": "5.2.13",
3+
"version": "5.2.14",
44
"os": ["linux", "win32"],
55
"cpu": ["x64"],
66
"keywords": [

0 commit comments

Comments
 (0)