1 // Copyright 2019 The BoringSSL Authors
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 //     https://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 
15 #include <openssl/ssl.h>
16 
17 int BORINGSSL_enum_c_type_test(void);
18 
BORINGSSL_enum_c_type_test(void)19 int BORINGSSL_enum_c_type_test(void) {
20 #if defined(__cplusplus)
21 #error "This is testing the behaviour of the C compiler."
22 #error "It's pointless to build it in C++ mode."
23 #endif
24 
25   // In C++, the enums in ssl.h are explicitly typed as ints to allow them to
26   // be predeclared. This function confirms that the C compiler believes them
27   // to be the same size as ints. They may differ in signedness, however.
28   return sizeof(enum ssl_private_key_result_t) == sizeof(int);
29 }
30