unistd.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2011 by Qualcomm Atheros.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software
  6. * for any purpose with or without fee is hereby granted, provided
  7. * that the above copyright notice and this permission notice appear
  8. * in all copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
  13. * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
  14. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  15. * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  16. * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  17. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  18. *
  19. *--------------------------------------------------------------------*/
  20. /*====================================================================*
  21. *
  22. * unistd.h - substitute unistd.h file for Windows;
  23. *
  24. * this is an important POSIX header that Microsoft ommits;
  25. *
  26. * Contributor(s):
  27. * Charles Maier
  28. * Nathaniel Houghton
  29. * Abdel Younes
  30. *
  31. *--------------------------------------------------------------------*/
  32. #ifndef UNISTD_HEADER
  33. #define UNISTD_HEADER
  34. /*====================================================================*
  35. * system header files
  36. *--------------------------------------------------------------------*/
  37. #if defined (WIN32)
  38. #include <io.h>
  39. #endif
  40. /*====================================================================*
  41. *
  42. *--------------------------------------------------------------------*/
  43. #define STDIN_FILENO 0
  44. #define STDOUT_FILENO 1
  45. #define STDERR_FILENO 2
  46. /*====================================================================*
  47. *
  48. *--------------------------------------------------------------------*/
  49. #if defined (WIN32)
  50. #define sleep(x) Sleep(1000*(x))
  51. #define strcasecmp(a,b) stricmp(a,b)
  52. typedef signed ssize_t;
  53. #endif
  54. #if !defined (_MSC_VER) || _MSC_VER < 1500
  55. #define vsnprintf _vsnprintf
  56. #endif
  57. #if !defined (_MSC_VER) || _MSC_VER < 1900
  58. #define snprintf _snprintf
  59. #endif
  60. /*====================================================================*
  61. *
  62. *--------------------------------------------------------------------*/
  63. #endif