From d24b64e55b841d9a4c973de2872724d1614eb04f Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Thu, 16 Jun 2022 04:47:23 -0700 Subject: [PATCH] to_c: fix link_dll_lib on windows, fix some include gaurds. --- include/cppad/utility/create_dll_lib.hpp | 4 ++-- include/cppad/utility/link_dll_lib.hpp | 10 ++++++---- test_more/general/to_csrc.cpp | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/cppad/utility/create_dll_lib.hpp b/include/cppad/utility/create_dll_lib.hpp index a8b86a068..77584401e 100644 --- a/include/cppad/utility/create_dll_lib.hpp +++ b/include/cppad/utility/create_dll_lib.hpp @@ -1,5 +1,5 @@ -# ifndef CPPAD_CREATE_DLL_LIB_HPP -# define CPPAD_CREATE_DLL_LIB_HPP +# ifndef CPPAD_UTILITY_CREATE_DLL_LIB_HPP +# define CPPAD_UTILITY_CREATE_DLL_LIB_HPP /* -------------------------------------------------------------------------- CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-22 Bradley M. Bell diff --git a/include/cppad/utility/link_dll_lib.hpp b/include/cppad/utility/link_dll_lib.hpp index f968b9cfe..e1aae6d65 100644 --- a/include/cppad/utility/link_dll_lib.hpp +++ b/include/cppad/utility/link_dll_lib.hpp @@ -1,5 +1,5 @@ -# ifndef CPPAD_LINK_DLL_LIB_HPP -# define CPPAD_LINK_DLL_LIB_HPP +# ifndef CPPAD_UTILITY_LINK_DLL_LIB_HPP +# define CPPAD_UTILITY_LINK_DLL_LIB_HPP /* -------------------------------------------------------------------------- CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-22 Bradley M. Bell @@ -31,7 +31,8 @@ in the Eclipse Public License, Version 2.0 are satisfied: // dlopen, dlsym, dlerror, dlclose, RTLD_LAZY # include # else -// RTLD_LAZY +// LoadLibrary, GetProcAddress, FreeLibrary, GetLastError, RTLD_LAZY +# include # define RTLD_LAZY 0 # endif @@ -42,8 +43,9 @@ class link_dll_lib { // pointer to the dll object void* handle_; // - // error during constructor + // error message during constructor std::string ctor_err_msg_; + // # ifdef _WIN32 // dlopen static void* dlopen(const char *filename, int flag) diff --git a/test_more/general/to_csrc.cpp b/test_more/general/to_csrc.cpp index c03721c6e..e600f7050 100644 --- a/test_more/general/to_csrc.cpp +++ b/test_more/general/to_csrc.cpp @@ -10,8 +10,8 @@ in the Eclipse Public License, Version 2.0 are satisfied: GNU General Public License, Version 2.0 or later. ---------------------------------------------------------------------------- */ # include -# include # include +# include // CALL_CONVENTION, CALL_IMPORT # ifdef _MSC_VER