Revision: 75863
          http://sourceforge.net/p/brlcad/code/75863
Author:   starseeker
Date:     2020-05-21 12:56:40 +0000 (Thu, 21 May 2020)
Log Message:
-----------
This works on Linux, but the key will be whether these tests succeed and fail 
properly on Windows.

Modified Paths:
--------------
    brlcad/branches/bioh/CMakeLists.txt
    brlcad/branches/bioh/include/common.h
    brlcad/branches/bioh/regress/pkg/CMakeLists.txt
    brlcad/branches/bioh/regress/pkg/regress_pkg.cpp

Modified: brlcad/branches/bioh/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/CMakeLists.txt 2020-05-21 06:02:18 UTC (rev 75862)
+++ brlcad/branches/bioh/CMakeLists.txt 2020-05-21 12:56:40 UTC (rev 75863)
@@ -1969,7 +1969,20 @@
   CONFIG_H_APPEND(BRLCAD "#define HAVE_WARN_UNUSED_RESULT_ATTRIBUTE 1\n")
 endif(HAVE_WARN_UNUSED_RESULT_ATTRIBUTE)
 
+# Check whether the compiler supports __attribute__((visibility ("default")))
+check_c_source_compiles(" __attribute__((visibility (\"default\"))) int 
*func(int *); int *func(int *v){(*v)-=1; return v;} int main(int argc, char 
*argv[]) {int v = 1; int *vp = func(&v); return *vp;}" 
HAVE_VISIBILITY_DEFAULT_ATTRIBUTE)
+if(HAVE_VISIBILITY_DEFAULT_ATTRIBUTE)
+  CONFIG_H_APPEND(BRLCAD "#define COMPILER_DLLEXPORT __attribute__ 
((visibility (\"default\")))\n")
+  CONFIG_H_APPEND(BRLCAD "#define COMPILER_DLLIMPORT __attribute__ 
((visibility (\"default\")))\n")
+endif(HAVE_VISIBILITY_DEFAULT_ATTRIBUTE)
 
+# Check whether the compiler supports __declspec(dllexport)
+check_c_source_compiles(" __declspec(dllexport) int *func(int *); int 
*func(int *v){(*v)-=1; return v;} int main(int argc, char *argv[]) {int v = 1; 
int *vp = func(&v); return *vp;}" HAVE_DECLSPEC_EXPORT_ATTRIBUTE)
+if(HAVE_DECLSPEC_EXPORT_ATTRIBUTE)
+  CONFIG_H_APPEND(BRLCAD "#define COMPILER_DLLEXPORT __declspec(dllexport)\n")
+  CONFIG_H_APPEND(BRLCAD "#define COMPILER_DLLIMPORT __declspec(dllimport)\n")
+endif(HAVE_DECLSPEC_EXPORT_ATTRIBUTE)
+
 # Silence check for unused arguments (used to silence clang warnings about
 # unused options on the command line). By default clang generates a lot of
 # warnings about such arguments, and we don't really care.

Modified: brlcad/branches/bioh/include/common.h
===================================================================
--- brlcad/branches/bioh/include/common.h       2020-05-21 06:02:18 UTC (rev 
75862)
+++ brlcad/branches/bioh/include/common.h       2020-05-21 12:56:40 UTC (rev 
75863)
@@ -524,18 +524,6 @@
 #  define CPP_FILELINE __FILE__ ":" CPP_XSTR(__LINE__)
 #endif
 
-/**
- * Different platforms use different compiler syntax for
- * exporting and importing symbols.
- */
-#if defined(_WIN32)
-# define COMPILER_DLLEXPORT COMPILER_DLLEXPORT
-# define COMPILER_DLLIMPORT DLLIMPORT
-#else
-# define COMPILER_DLLEXPORT __attribute__ ((visibility ("default")))
-# define COMPILER_DLLIMPORT __attribute__ ((visibility ("default")))
-#endif
-
 #endif  /* COMMON_H */
 
 /** @} */

Modified: brlcad/branches/bioh/regress/pkg/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/regress/pkg/CMakeLists.txt     2020-05-21 06:02:18 UTC 
(rev 75862)
+++ brlcad/branches/bioh/regress/pkg/CMakeLists.txt     2020-05-21 12:56:40 UTC 
(rev 75863)
@@ -6,6 +6,7 @@
   )
 
 BRLCAD_ADDEXEC(regress_pkg regress_pkg.cpp 
"libpkg;libbu;${CMAKE_THREAD_LIBS_INIT}" NO_INSTALL)
+target_compile_definitions(regress_pkg PUBLIC BRLCADBUILD HAVE_CONFIG_H)
 set_target_properties(regress_pkg PROPERTIES FOLDER "BRL-CAD Regression 
Tests/libpkg")
 
 add_test(NAME regress-pkg

Modified: brlcad/branches/bioh/regress/pkg/regress_pkg.cpp
===================================================================
--- brlcad/branches/bioh/regress/pkg/regress_pkg.cpp    2020-05-21 06:02:18 UTC 
(rev 75862)
+++ brlcad/branches/bioh/regress/pkg/regress_pkg.cpp    2020-05-21 12:56:40 UTC 
(rev 75863)
@@ -131,7 +131,7 @@
        } else if (client == PKC_ERROR) {
            pkg_close(client);
            client = PKC_NULL;
-           bu_log("ERROR: no clients connected to server after %d seconds 
waiting\n");
+           bu_log("ERROR: client == PKC_ERROR\n");
            bu_exit(-1, "Server exiting\n");
            continue;
        }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to