Permalink
Browse files

Rework Charmonizer symbol visibility tests

git-svn-id: https://svn.apache.org/repos/asf/lucy/trunk@1332249 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 95e4923 commit decce0f33653edb8807f22eb0ae032e74dbedab0 @nwellnhof nwellnhof committed Apr 30, 2012
Showing with 10 additions and 19 deletions.
  1. +10 −19 charmonizer/src/Charmonizer/Probe/SymbolVisibility.c
@@ -36,39 +36,30 @@ void
SymbolVisibility_run(void) {
int can_control_visibility = false;
char code_buf[sizeof(symbol_exporting_code) + 100];
- char export_gcc[] = "__attribute__ ((visibility (\"default\")))";
ConfWriter_start_module("SymbolVisibility");
- /* GCC. */
- sprintf(code_buf, symbol_exporting_code, export_gcc);
- if (CC_test_compile(code_buf, strlen(code_buf))) {
- can_control_visibility = true;
- ConfWriter_append_conf("#define CHY_EXPORT %s\n", export_gcc);
- ConfWriter_append_conf("#define CHY_IMPORT\n");
- }
+ /* Windows. */
if (!can_control_visibility) {
- char export_gcc_win[] = "__attribute__ ((dllexport))";
- sprintf(code_buf, symbol_exporting_code, export_gcc_win);
+ char export_win[] = "__declspec(dllexport)";
+ sprintf(code_buf, symbol_exporting_code, export_win);
if (CC_test_compile(code_buf, strlen(code_buf))) {
can_control_visibility = true;
- ConfWriter_append_conf("#define CHY_EXPORT %s\n", export_gcc_win);
+ ConfWriter_append_conf("#define CHY_EXPORT %s\n", export_win);
ConfWriter_append_conf(
- "#define CHY_IMPORT __attribute__ ((dllimport))\n"
+ "#define CHY_IMPORT __declspec(dllimport)\n"
);
}
}
- /* Windows. */
+ /* GCC. */
if (!can_control_visibility) {
- char export_win[] = "__declspec(dllexport)";
- sprintf(code_buf, symbol_exporting_code, export_win);
+ char export_gcc[] = "__attribute__ ((visibility (\"default\")))";
+ sprintf(code_buf, symbol_exporting_code, export_gcc);
if (CC_test_compile(code_buf, strlen(code_buf))) {
can_control_visibility = true;
- ConfWriter_append_conf("#define CHY_EXPORT %s\n", export_win);
- ConfWriter_append_conf(
- "#define CHY_IMPORT __declspec(dllimport)\n"
- );
+ ConfWriter_append_conf("#define CHY_EXPORT %s\n", export_gcc);
+ ConfWriter_append_conf("#define CHY_IMPORT\n");
}
}

0 comments on commit decce0f

Please sign in to comment.