Skip to content

Commit

Permalink
cephes extern export
Browse files Browse the repository at this point in the history
  • Loading branch information
talregev committed Dec 31, 2023
1 parent 3abaff1 commit 3c2ff14
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
1 change: 1 addition & 0 deletions gtsam/3rdparty/cephes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ project(

set(CEPHES_HEADER_FILES
cephes.h
dllexport.h
cephes/cephes_names.h
cephes/dd_idefs.h
cephes/dd_real.h
Expand Down
3 changes: 2 additions & 1 deletion gtsam/3rdparty/cephes/cephes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define CEPHES_H

#include "cephes/cephes_names.h"
#include "dllexport.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -64,7 +65,7 @@ extern double igamc(double a, double x);
extern double igam(double a, double x);
extern double igam_fac(double a, double x);
extern double igamci(double a, double q);
extern double igami(double a, double p);
GTSAM_EXTERN_EXPORT double igami(double a, double p);

extern double incbet(double aa, double bb, double xx);
extern double incbi(double aa, double bb, double yy0);
Expand Down
60 changes: 60 additions & 0 deletions gtsam/3rdparty/cephes/dllexport.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */

/**
* @file dllexport.h
* @brief Symbols for exporting classes and methods from DLLs
* @author Richard Roberts
* @date Mar 9, 2013
*/

// Macros for exporting DLL symbols on Windows
// Usage example:
// In header file:
// class GTSAM_EXPORT MyClass { ... };
//
// Results in the following declarations:
// When included while compiling the GTSAM library itself:
// class __declspec(dllexport) MyClass { ... };
// When included while compiling other code against GTSAM:
// class __declspec(dllimport) MyClass { ... };

#pragma once

// Whether GTSAM is compiled as static or DLL in windows.
// This will be used to decide whether include __declspec(dllimport) or not in headers
#define GTSAM_SHARED_LIB

#ifdef _WIN32
# ifndef GTSAM_SHARED_LIB
# define GTSAM_EXPORT
# define GTSAM_EXTERN_EXPORT extern
# else
# ifdef GTSAM_EXPORTS
# define GTSAM_EXPORT __declspec(dllexport)
# define GTSAM_EXTERN_EXPORT __declspec(dllexport) extern
# else
# define GTSAM_EXPORT __declspec(dllimport)
# define GTSAM_EXTERN_EXPORT __declspec(dllimport)
# endif
# endif
#else
#ifdef __APPLE__
# define GTSAM_EXPORT __attribute__((visibility("default")))
# define GTSAM_EXTERN_EXPORT extern
#else
# define GTSAM_EXPORT
# define GTSAM_EXTERN_EXPORT extern
#endif
#endif

#undef GTSAM_SHARED_LIB

0 comments on commit 3c2ff14

Please sign in to comment.