paths.h.in 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* -*- C -*- */
  2. #include "lua.h"
  3. #include "lauxlib.h"
  4. #include <stdlib.h>
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <ctype.h>
  8. #if defined(_WIN32) || defined(LUA_WIN)
  9. # ifdef paths_EXPORTS
  10. # define PATHS_API __declspec(dllexport)
  11. # else
  12. # define PATHS_API __declspec(dllimport)
  13. # endif
  14. #else
  15. # define PATHS_API /**/
  16. #endif
  17. #if defined(_WIN32) || defined(LUA_WIN)
  18. # include <errno.h>
  19. # include <windows.h>
  20. # include <direct.h>
  21. # include <io.h>
  22. # include <time.h>
  23. # include <process.h>
  24. # include <fcntl.h>
  25. # include <sys/types.h>
  26. # include <sys/stat.h>
  27. #else
  28. #cmakedefine HAVE_DIRENT_H 1
  29. #cmakedefine HAVE_FCNTL_H 1
  30. #cmakedefine HAVE_UNISTD_H 1
  31. #cmakedefine HAVE_TIME_H 1
  32. #cmakedefine HAVE_SYS_TIME_H 1
  33. #cmakedefine HAVE_SYS_NDIR_H 1
  34. #cmakedefine HAVE_SYS_DIR_H 1
  35. #cmakedefine HAVE_SYS_UTSNAME_H 1
  36. #cmakedefine HAVE_NDIR_H 1
  37. #cmakedefine HAVE_GETCWD 1
  38. #cmakedefine HAVE_DLOPEN 1
  39. # include <errno.h>
  40. # include <sys/types.h>
  41. # include <sys/stat.h>
  42. # if HAVE_FCNTL_H
  43. # include <fcntl.h>
  44. # endif
  45. # if HAVE_UNISTD_H
  46. # include <unistd.h>
  47. # endif
  48. # if HAVE_SYS_TIME_H
  49. # include <sys/time.h>
  50. # endif
  51. # if HAVE_SYS_UTSNAME_H
  52. # include <sys/utsname.h>
  53. # endif
  54. # if HAVE_TIME_H
  55. # include <time.h>
  56. # endif
  57. # ifdef HAVE_UNISTD_H
  58. # include <unistd.h>
  59. # endif
  60. # ifdef HAVE_DIRENT_H
  61. # include <dirent.h>
  62. # define NAMLEN(dirent) strlen((dirent)->d_name)
  63. # else
  64. # define dirent direct
  65. # define NAMLEN(dirent) (dirent)->d_namlen
  66. # if HAVE_SYS_NDIR_H
  67. # include <sys/ndir.h>
  68. # endif
  69. # if HAVE_SYS_DIR_H
  70. # include <sys/dir.h>
  71. # endif
  72. # if HAVE_NDIR_H
  73. # include <ndir.h>
  74. # endif
  75. # endif
  76. #endif