Skip to content

Commit 65e2adf

Browse files
committed
Fix OpenSSL::Engine build on Debian
On Debian 9 (“stretch”) the `OPENSSL_NO_STATIC_ENGINE` macro is not defined, which causes all the `#if HAVE_ENGINE_LOAD_…` directives to fail with `error: 'HAVE_ENGINE_LOAD_…' is not defined, evaluates to 0 [-Werror,-Wundef]` while building TruffleRuby. We can accomplish the same thing with `#ifdef`, which (of course) works fine when the `HAVE_ENGINE_LOAD…` macros are also undefined. Upstreamed from truffleruby/truffleruby#2255, which fixed truffleruby/truffleruby#2254.
1 parent 4f1f5bd commit 65e2adf

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

ext/openssl/ossl_engine.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,48 +101,48 @@ ossl_engine_s_load(int argc, VALUE *argv, VALUE klass)
101101
return Qtrue;
102102
}
103103
StringValueCStr(name);
104-
#if HAVE_ENGINE_LOAD_DYNAMIC
104+
#ifdef HAVE_ENGINE_LOAD_DYNAMIC
105105
OSSL_ENGINE_LOAD_IF_MATCH(dynamic, DYNAMIC);
106106
#endif
107107
#ifndef OPENSSL_NO_STATIC_ENGINE
108-
#if HAVE_ENGINE_LOAD_4758CCA
108+
#ifdef HAVE_ENGINE_LOAD_4758CCA
109109
OSSL_ENGINE_LOAD_IF_MATCH(4758cca, 4758CCA);
110110
#endif
111-
#if HAVE_ENGINE_LOAD_AEP
111+
#ifdef HAVE_ENGINE_LOAD_AEP
112112
OSSL_ENGINE_LOAD_IF_MATCH(aep, AEP);
113113
#endif
114-
#if HAVE_ENGINE_LOAD_ATALLA
114+
#ifdef HAVE_ENGINE_LOAD_ATALLA
115115
OSSL_ENGINE_LOAD_IF_MATCH(atalla, ATALLA);
116116
#endif
117-
#if HAVE_ENGINE_LOAD_CHIL
117+
#ifdef HAVE_ENGINE_LOAD_CHIL
118118
OSSL_ENGINE_LOAD_IF_MATCH(chil, CHIL);
119119
#endif
120-
#if HAVE_ENGINE_LOAD_CSWIFT
120+
#ifdef HAVE_ENGINE_LOAD_CSWIFT
121121
OSSL_ENGINE_LOAD_IF_MATCH(cswift, CSWIFT);
122122
#endif
123-
#if HAVE_ENGINE_LOAD_NURON
123+
#ifdef HAVE_ENGINE_LOAD_NURON
124124
OSSL_ENGINE_LOAD_IF_MATCH(nuron, NURON);
125125
#endif
126-
#if HAVE_ENGINE_LOAD_SUREWARE
126+
#ifdef HAVE_ENGINE_LOAD_SUREWARE
127127
OSSL_ENGINE_LOAD_IF_MATCH(sureware, SUREWARE);
128128
#endif
129-
#if HAVE_ENGINE_LOAD_UBSEC
129+
#ifdef HAVE_ENGINE_LOAD_UBSEC
130130
OSSL_ENGINE_LOAD_IF_MATCH(ubsec, UBSEC);
131131
#endif
132-
#if HAVE_ENGINE_LOAD_PADLOCK
132+
#ifdef HAVE_ENGINE_LOAD_PADLOCK
133133
OSSL_ENGINE_LOAD_IF_MATCH(padlock, PADLOCK);
134134
#endif
135-
#if HAVE_ENGINE_LOAD_CAPI
135+
#ifdef HAVE_ENGINE_LOAD_CAPI
136136
OSSL_ENGINE_LOAD_IF_MATCH(capi, CAPI);
137137
#endif
138-
#if HAVE_ENGINE_LOAD_GMP
138+
#ifdef HAVE_ENGINE_LOAD_GMP
139139
OSSL_ENGINE_LOAD_IF_MATCH(gmp, GMP);
140140
#endif
141-
#if HAVE_ENGINE_LOAD_GOST
141+
#ifdef HAVE_ENGINE_LOAD_GOST
142142
OSSL_ENGINE_LOAD_IF_MATCH(gost, GOST);
143143
#endif
144144
#endif
145-
#if HAVE_ENGINE_LOAD_CRYPTODEV
145+
#ifdef HAVE_ENGINE_LOAD_CRYPTODEV
146146
OSSL_ENGINE_LOAD_IF_MATCH(cryptodev, CRYPTODEV);
147147
#endif
148148
OSSL_ENGINE_LOAD_IF_MATCH(openssl, OPENSSL);

0 commit comments

Comments
 (0)