11#include "libblastrampoline_internal.h"
22#include "libblastrampoline_trampdata.h"
3- #include "libblastrampoline_complex_retdata.h"
43
4+ #ifdef COMPLEX_RETSTYLE_AUTODETECTION
5+ #include "libblastrampoline_complex_retdata.h"
6+ #endif
57#ifdef F2C_AUTODETECTION
68#include "libblastrampoline_f2cdata.h"
79#endif
@@ -67,6 +69,7 @@ int32_t set_forward_by_index(int32_t symbol_idx, const void * addr, int32_t inte
6769 }
6870 }
6971
72+ #ifdef COMPLEX_RETSTYLE_AUTODETECTION
7073 if (complex_retstyle == LBT_COMPLEX_RETSTYLE_ARGUMENT ) {
7174 // Check to see if this symbol is one of the complex-returning functions
7275 for (int complex_symbol_idx = 0 ; cmplxret_func_idxs [complex_symbol_idx ] != -1 ; ++ complex_symbol_idx ) {
@@ -90,6 +93,7 @@ int32_t set_forward_by_index(int32_t symbol_idx, const void * addr, int32_t inte
9093 }
9194 }
9295 }
96+ #endif // COMPLEX_RETSTYLE_AUTODETECTION
9397
9498#ifdef F2C_AUTODETECTION
9599 if (f2c == LBT_F2C_REQUIRED ) {
@@ -216,7 +220,9 @@ LBT_DLLEXPORT int32_t lbt_forward(const char * libname, int32_t clear, int32_t v
216220 }
217221
218222 // Next, let's figure out what the complex return style is:
219- int complex_retstyle = autodetect_complex_return_style (handle , lib_suffix );
223+ int complex_retstyle = LBT_COMPLEX_RETSTYLE_UNKNOWN ;
224+ #ifdef COMPLEX_RETSTYLE_AUTODETECTION
225+ complex_retstyle = autodetect_complex_return_style (handle , lib_suffix );
220226 if (complex_retstyle == LBT_COMPLEX_RETSTYLE_UNKNOWN ) {
221227 fprintf (stderr , "Unable to autodetect complex return style of \"%s\"\n" , libname );
222228 return 0 ;
@@ -229,6 +235,7 @@ LBT_DLLEXPORT int32_t lbt_forward(const char * libname, int32_t clear, int32_t v
229235 printf (" -> Autodetected argument-passing complex return style\n" );
230236 }
231237 }
238+ #endif // COMPLEX_RETSTYLE_AUTODETECTION
232239
233240 int f2c = LBT_F2C_PLAIN ;
234241#ifdef F2C_AUTODETECTION
@@ -247,7 +254,7 @@ LBT_DLLEXPORT int32_t lbt_forward(const char * libname, int32_t clear, int32_t v
247254 printf (" -> Autodetected gfortran calling convention\n" );
248255 }
249256 }
250- #endif
257+ #endif // F2C_AUTODETECTION
251258
252259 int cblas = LBT_CBLAS_UNKNOWN ;
253260#ifdef CBLAS_DIVERGENCE_AUTODETECTION
@@ -273,7 +280,7 @@ LBT_DLLEXPORT int32_t lbt_forward(const char * libname, int32_t clear, int32_t v
273280 }
274281 }
275282 }
276- #endif
283+ #endif // CBLAS_DIVERGENCE_AUTODETECTION
277284
278285 /*
279286 * Now, if we are opening a 64-bit library with 32-bit names (e.g. suffix == ""),
@@ -378,7 +385,7 @@ LBT_DLLEXPORT int32_t lbt_forward(const char * libname, int32_t clear, int32_t v
378385 }
379386 }
380387 }
381- #endif
388+ #endif // CBLAS_DIVERGENCE_AUTODETECTION
382389
383390 record_library_load (libname , handle , lib_suffix , & forwards [0 ], interface , complex_retstyle , f2c , cblas );
384391 if (verbose ) {
0 commit comments