mingw_support.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: LGPL-2.0+ */
  2. /*
  3. * Copyright 2008 Extreme Engineering Solutions, Inc.
  4. */
  5. #ifndef __MINGW_SUPPORT_H_
  6. #define __WINGW_SUPPORT_H_ 1
  7. /* Defining __INSIDE_MSYS__ helps to prevent u-boot/mingw overlap */
  8. #define __INSIDE_MSYS__ 1
  9. #include <windows.h>
  10. /* mmap protections */
  11. #define PROT_READ 0x1 /* Page can be read */
  12. #define PROT_WRITE 0x2 /* Page can be written */
  13. #define PROT_EXEC 0x4 /* Page can be executed */
  14. #define PROT_NONE 0x0 /* Page can not be accessed */
  15. /* Sharing types (must choose one and only one of these) */
  16. #define MAP_SHARED 0x01 /* Share changes */
  17. #define MAP_PRIVATE 0x02 /* Changes are private */
  18. /* File perms */
  19. #ifndef S_IRGRP
  20. # define S_IRGRP 0
  21. #endif
  22. #ifndef S_IWGRP
  23. # define S_IWGRP 0
  24. #endif
  25. /* Windows 64-bit access macros */
  26. #define LODWORD(x) ((DWORD)((DWORDLONG)(x)))
  27. #define HIDWORD(x) ((DWORD)(((DWORDLONG)(x) >> 32) & 0xffffffff))
  28. typedef UINT uint;
  29. typedef ULONG ulong;
  30. int fsync(int fd);
  31. void *mmap(void *, size_t, int, int, int, int);
  32. int munmap(void *, size_t);
  33. char *strtok_r(char *s, const char *delim, char **save_ptr);
  34. #include "getline.h"
  35. #endif /* __MINGW_SUPPORT_H_ */