🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1023 B

  1. /*
  2. * Test program to make sure that dirent compiles cleanly with winsock.
  3. *
  4. * Copyright (C) 1998-2019 Toni Ronkko
  5. * This file is part of dirent. Dirent may be freely distributed
  6. * under the MIT license. For all details and documentation, see
  7. * https://github.com/tronkko/dirent
  8. */
  9. #include <dirent.h>
  10. #ifdef WIN32
  11. # include <winsock2.h>
  12. # include <ws2tcpip.h>
  13. #endif
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16. #include <string.h>
  17. int
  18. main(
  19. int argc, char *argv[])
  20. {
  21. struct dirent *dirp = NULL;
  22. (void) argc;
  23. (void) argv;
  24. #ifdef _DIRENT_HAVE_D_TYPE
  25. printf ("Has d_type\n");
  26. #endif
  27. #ifdef _DIRENT_HAVE_D_NAMLEN
  28. printf ("Has d_namlen\n");
  29. #endif
  30. #ifdef _D_EXACT_NAMLEN
  31. printf ("Has _D_EXACT_NAMLEN\n");
  32. #endif
  33. #ifdef _D_ALLOC_NAMLEN
  34. printf ("Has _D_ALLOC_NAMLEN\n");
  35. #endif
  36. #ifdef _D_ALLOC_NAMLEN
  37. printf ("Has _D_ALLOC_NAMLEN\n");
  38. #endif
  39. printf ("Length of d_name with terminator: %d\n",
  40. (int) sizeof (dirp->d_name));
  41. printf ("OK\n");
  42. return EXIT_SUCCESS;
  43. }