Skip to content

Commit

Permalink
to_c: fix link_dll_lib on windows, fix some include gaurds.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbell committed Jun 16, 2022
1 parent 88f21db commit d24b64e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions 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
Expand Down
10 changes: 6 additions & 4 deletions 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
Expand Down Expand Up @@ -31,7 +31,8 @@ in the Eclipse Public License, Version 2.0 are satisfied:
// dlopen, dlsym, dlerror, dlclose, RTLD_LAZY
# include <dlfcn.h>
# else
// RTLD_LAZY
// LoadLibrary, GetProcAddress, FreeLibrary, GetLastError, RTLD_LAZY
# include <windows.h>
# define RTLD_LAZY 0
# endif

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test_more/general/to_csrc.cpp
Expand Up @@ -10,8 +10,8 @@ in the Eclipse Public License, Version 2.0 are satisfied:
GNU General Public License, Version 2.0 or later.
---------------------------------------------------------------------------- */
# include <filesystem>
# include <cppad/utility/link_dll_lib.hpp>
# include <cppad/cppad.hpp>
# include <cppad/utility/link_dll_lib.hpp>

// CALL_CONVENTION, CALL_IMPORT
# ifdef _MSC_VER
Expand Down

0 comments on commit d24b64e

Please sign in to comment.