mingw_support.h 1.1 KB

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