platform.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Tencent is pleased to support the open source community by making IoT Hub
  3. available.
  4. * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
  5. * Licensed under the MIT License (the "License"); you may not use this file
  6. except in
  7. * compliance with the License. You may obtain a copy of the License at
  8. * http://opensource.org/licenses/MIT
  9. * Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is
  11. * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12. KIND,
  13. * either express or implied. See the License for the specific language
  14. governing permissions and
  15. * limitations under the License.
  16. *
  17. */
  18. #ifndef PLATFORM_H_
  19. #define PLATFORM_H_
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #ifndef PATH_MAX
  24. #define PATH_MAX 4096
  25. #endif
  26. /* Max size of cert/key file full path */
  27. #define FILE_PATH_MAX_LEN 256
  28. #ifdef WIN32
  29. #include <Windows.h>
  30. #include <direct.h>
  31. #include <limits.h>
  32. typedef unsigned long ssize_t;
  33. #define getcwd(buffer, len) _getcwd(buffer, len)
  34. #endif
  35. #if defined(__linux__)
  36. #include <fcntl.h>
  37. #include <pthread.h>
  38. //#include <sys/time.h>
  39. #include <assert.h>
  40. #include <limits.h>
  41. #include <signal.h>
  42. #include <sys/types.h>
  43. #include <time.h>
  44. #include <unistd.h>
  45. #endif
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* PLATFORM_H_ */