ssl_c_test.c 539 B

123456789101112131415
  1. #include <openssl/ssl.h>
  2. int BORINGSSL_enum_c_type_test(void);
  3. int BORINGSSL_enum_c_type_test(void) {
  4. #if defined(__cplusplus)
  5. #error "This is testing the behaviour of the C compiler."
  6. #error "It's pointless to build it in C++ mode."
  7. #endif
  8. // In C++, the enums in ssl.h are explicitly typed as ints to allow them to
  9. // be predeclared. This function confirms that the C compiler believes them
  10. // to be the same size as ints. They may differ in signedness, however.
  11. return sizeof(enum ssl_private_key_result_t) == sizeof(int);
  12. }