diff --git a/vlib/net/openssl/openssl.c.v b/vlib/net/openssl/openssl.c.v index 51755382ff2e26..1012da6072a515 100644 --- a/vlib/net/openssl/openssl.c.v +++ b/vlib/net/openssl/openssl.c.v @@ -156,9 +156,7 @@ fn init() { } } -pub const ( - is_used = 1 -) +pub const is_used = true // ssl_error returns non error ssl code or error if unrecoverable and we should panic fn ssl_error(ret int, ssl voidptr) !SSLError { @@ -180,16 +178,15 @@ fn ssl_error(ret int, ssl voidptr) !SSLError { } enum SSLError { - ssl_error_none = 0 // SSL_ERROR_NONE - ssl_error_ssl = 1 // SSL_ERROR_SSL - ssl_error_want_read = 2 // SSL_ERROR_WANT_READ - ssl_error_want_write = 3 // SSL_ERROR_WANT_WRITE - ssl_error_want_x509_lookup = 4 // SSL_ERROR_WANT_X509_LOOKUP - ssl_error_syscall = 5 // SSL_ERROR_SYSCALL - ssl_error_zero_return = 6 // SSL_ERROR_ZERO_RETURN - ssl_error_want_connect = 7 // SSL_ERROR_WANT_CONNECT - ssl_error_want_accept = 8 // SSL_ERROR_WANT_ACCEPT - ssl_error_want_async = 9 // SSL_ERROR_WANT_ASYNC - ssl_error_want_async_job = 10 // SSL_ERROR_WANT_ASYNC_JOB - ssl_error_want_early = 11 // SSL_ERROR_WANT_EARLY + ssl_error_none = C.SSL_ERROR_NONE + ssl_error_ssl = C.SSL_ERROR_SSL + ssl_error_want_read = C.SSL_ERROR_WANT_READ + ssl_error_want_write = C.SSL_ERROR_WANT_WRITE + ssl_error_want_x509_lookup = C.SSL_ERROR_WANT_X509_LOOKUP + ssl_error_syscall = C.SSL_ERROR_SYSCALL + ssl_error_zero_return = C.SSL_ERROR_ZERO_RETURN + ssl_error_want_connect = C.SSL_ERROR_WANT_CONNECT + ssl_error_want_accept = C.SSL_ERROR_WANT_ACCEPT + ssl_error_want_async = C.SSL_ERROR_WANT_ASYNC + ssl_error_want_async_job = C.SSL_ERROR_WANT_ASYNC_JOB } diff --git a/vlib/net/openssl/openssl_compiles_test.c.v b/vlib/net/openssl/openssl_compiles_test.c.v index 17f2598d0c5b3b..32e72ad503852e 100644 --- a/vlib/net/openssl/openssl_compiles_test.c.v +++ b/vlib/net/openssl/openssl_compiles_test.c.v @@ -12,6 +12,6 @@ fn test_printing_struct_with_reference_field_of_type_ssl_ctx() { } fn test_openssl_compiles() { - assert openssl.is_used == 1 + assert openssl.is_used assert true }