Skip to content

Commit

Permalink
win,fs: avoid winapi macro redefinition (libuv#4123)
Browse files Browse the repository at this point in the history
Adjust include order to avoid redefining `CTL_CODE`, `FILE_READ_ACCESS`,
and `FILE_WRITE_ACCESS`.  Without this, compilation shows:

```
...\um\winioctl.h(273): warning C4005: 'CTL_CODE': macro redefinition
...\src\win\winapi.h(4497): note: see previous definition of 'CTL_CODE'

...\um\winioctl.h(320): warning C4005: 'FILE_READ_ACCESS': macro redefinition
...\src\win\winapi.h(4488): note: see previous definition of 'FILE_READ_ACCESS'

...\um\winioctl.h(321): warning C4005: 'FILE_WRITE_ACCESS': macro redefinition
...\src\win\winapi.h(4492): note: see previous definition of 'FILE_WRITE_ACCESS'
```
  • Loading branch information
bradking authored Aug 19, 2023
1 parent 65541f7 commit b375977
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/win/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@
#include <stdio.h>

#include "uv.h"

/* <winioctl.h> requires <windows.h>, included via "uv.h" above, but needs to
be included before our "winapi.h", included via "internal.h" below. */
#include <winioctl.h>

#include "internal.h"
#include "req-inl.h"
#include "handle-inl.h"
#include "fs-fd-hash-inl.h"

#include <winioctl.h>


#define UV_FS_FREE_PATHS 0x0002
#define UV_FS_FREE_PTR 0x0008
Expand Down

0 comments on commit b375977

Please sign in to comment.