msvc.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* MegaZeux
  2. *
  3. * Copyright (C) 2007 Alistair John Strachan <alistair@devzero.co.uk>
  4. * Copyright (C) 2017 Ian Burgmyer <spectere@gmail.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. // all MSVC specific hacks should go here, if possible
  21. #ifndef MSVC_H
  22. #define MSVC_H
  23. #include <io.h>
  24. #include <ctype.h>
  25. #include <direct.h>
  26. #include <process.h>
  27. #define S_ISREG(mode) (mode & _S_IFREG)
  28. #define S_ISDIR(mode) (mode & _S_IFDIR)
  29. #define chdir _chdir
  30. #define execv _execv
  31. #define getcwd _getcwd
  32. #define rmdir _rmdir
  33. #define unlink _unlink
  34. #ifndef strcasecmp
  35. #define strcasecmp _stricmp
  36. #endif
  37. #ifndef strncasecmp
  38. #define strncasecmp _strnicmp
  39. #endif
  40. #define mkdir(name,mode) _mkdir(name)
  41. #define inline __inline
  42. #ifdef _WIN64
  43. typedef __int64 ssize_t;
  44. #else
  45. typedef _W64 int ssize_t;
  46. #endif
  47. #endif // MSVC_H