std_headers.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2010 Google Inc. All rights reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // Includes some standard C headers for size_t, memset, etc.
  15. //
  16. // Also, permanently disables a number of warnings produced
  17. // by Microsoft's compiler when it includes standard headers
  18. // (surprisingly, also by Microsoft).
  19. #ifndef CRCUTIL_STD_HEADERS_H_
  20. #define CRCUTIL_STD_HEADERS_H_
  21. #if defined(_MSC_VER)
  22. // '4' bytes padding added after data member ...
  23. #pragma warning(disable:4820)
  24. // unreferenced inline function has been removed ...
  25. #pragma warning(disable:4514)
  26. // conditional expression is constant
  27. #pragma warning(disable: 4127)
  28. // function ... not inlined
  29. #pragma warning(disable: 4710)
  30. // function ... selected for automatic inline expansion
  31. #pragma warning(disable: 4711)
  32. #ifndef _CRT_SECURE_NO_WARNINGS
  33. #define _CRT_SECURE_NO_WARNINGS
  34. #endif
  35. #endif // defined(_MSC_VER)
  36. // #define _CSTDLIB_
  37. #include <stdio.h> // always handy
  38. #include <string.h> // memset
  39. #include <stdlib.h> // size_t, _rotl/_rotl64(MSC)
  40. #include <stddef.h> // ptrdiff_t (GNUC)
  41. #include <stdarg.h> // va_list
  42. #endif // CRCUTIL_STD_HEADERS_H_