Skip to content

Commit

Permalink
libfityk: use FITYK_API macro to explicitely set visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
wojdyr committed Nov 5, 2012
1 parent 05d8807 commit 352f6b5
Show file tree
Hide file tree
Showing 53 changed files with 161 additions and 96 deletions.
1 change: 1 addition & 0 deletions fityk/CMPfit.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of fityk program. Copyright (C) Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#define BUILDING_LIBFITYK
#include "CMPfit.h"
#include "logic.h"
#include "data.h"
Expand Down
4 changes: 3 additions & 1 deletion fityk/GAfit.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// This file is part of fityk program. Copyright (C) Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#define BUILDING_LIBFITYK
#include "GAfit.h"

#include <stdlib.h>
#include <time.h>
#include <algorithm>
Expand All @@ -9,7 +12,6 @@
#include <math.h>

#include "common.h"
#include "GAfit.h"
#include "logic.h"
#include "settings.h"
#include "numfuncs.h"
Expand Down
11 changes: 7 additions & 4 deletions fityk/LMfit.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// This file is part of fityk program. Copyright (C) Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#include "common.h"
#define BUILDING_LIBFITYK
#include "LMfit.h"
#include "ui.h"
#include "settings.h"
#include "logic.h"

#include <math.h>
#include <vector>
#include <algorithm>

#include "common.h"
#include "ui.h"
#include "settings.h"
#include "logic.h"

using namespace std;

namespace fityk {
Expand Down
1 change: 1 addition & 0 deletions fityk/NLfit.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of fityk program. Copyright Marcin Wojdyr.
// Licence: GNU General Public License ver. 2+

#define BUILDING_LIBFITYK
#include "NLfit.h"
#include "logic.h"
#include "data.h"
Expand Down
4 changes: 3 additions & 1 deletion fityk/NMfit.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// This file is part of fityk program. Copyright (C) Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#define BUILDING_LIBFITYK
#include "NMfit.h"

#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <vector>

#include "common.h"
#include "NMfit.h"
#include "logic.h"
#include "settings.h"

Expand Down
4 changes: 3 additions & 1 deletion fityk/ast.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// This file is part of fityk program. Copyright (C) 2005 Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#define BUILDING_LIBFITYK
#include "ast.h"

#include <boost/math/special_functions/gamma.hpp>
#include <boost/math/special_functions/digamma.hpp>

Expand All @@ -12,7 +15,6 @@

#include "common.h"
#include "ui.h"
#include "ast.h"
#include "var.h"
#include "logic.h"
#include "numfuncs.h"
Expand Down
1 change: 1 addition & 0 deletions fityk/bfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licence: GNU General Public License ver. 2+
/// Built-in function definitions

#define BUILDING_LIBFITYK
#include "bfunc.h"

#include <boost/math/special_functions/gamma.hpp>
Expand Down
1 change: 1 addition & 0 deletions fityk/common.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of fityk program. Copyright (C) Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#define BUILDING_LIBFITYK
#include "common.h"
#include <string>
#include <time.h>
Expand Down
11 changes: 6 additions & 5 deletions fityk/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ namespace fityk {

/// epsilon is used for comparision of real numbers
/// defined in settings.cpp; it can be changed in Settings
extern double epsilon;
extern FITYK_API double epsilon;

inline bool is_eq(double a, double b) { return fabs(a-b) <= epsilon; }
inline bool is_neq(double a, double b) { return fabs(a-b) > epsilon; }
Expand Down Expand Up @@ -253,8 +253,8 @@ bool is_double (std::string const& s);
bool is_int (std::string const& s);

/// replace all occurences of old in string s with new_
void replace_all(std::string &s, std::string const &old,
std::string const &new_);
FITYK_API void replace_all(std::string &s, std::string const &old,
std::string const &new_);

void replace_words(std::string &t, std::string const &old_word,
std::string const &new_word);
Expand All @@ -269,7 +269,7 @@ bool match_glob(const char* name, const char* pattern);
// v e c t o r

/// Make (u-l)-element vector, filled by numbers: l, l+1, ..., u-1.
std::vector<int> range_vector(int l, int u);
FITYK_API std::vector<int> range_vector(int l, int u);

/// Expression like "i<v.size()", where i is int and v is a std::vector gives:
/// "warning: comparison between signed and unsigned integer expressions"
Expand Down Expand Up @@ -299,7 +299,8 @@ inline std::string get_directory(std::string const& filename)
TypeName(const TypeName&); \
void operator=(const TypeName&)

extern const char* fityk_version_line; /// it is used to put version to script
/// used to put version to script
extern FITYK_API const char* fityk_version_line;

extern const std::string help_filename;

Expand Down
1 change: 1 addition & 0 deletions fityk/cparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

/// Command parser.

#define BUILDING_LIBFITYK
#include "cparser.h"

#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion fityk/cparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ extern const char* debug_args[];

const char* commandtype2str(CommandType c);

class Parser
class FITYK_API Parser
{
public:
Parser(const Ftk* F);
Expand Down
3 changes: 2 additions & 1 deletion fityk/data.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// This file is part of fityk program. Copyright (C) Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#include "common.h"
#define BUILDING_LIBFITYK
#include "data.h"
#include "common.h"
#include "ui.h"
#include "numfuncs.h"
#include "settings.h"
Expand Down
6 changes: 3 additions & 3 deletions fityk/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
#include <limits.h>
#include "common.h"

#include "fityk.h" // struct Point
#include "fityk.h" // struct Point, FITYK_API

namespace fityk {

class Ftk;

std::string get_file_basename(std::string const& path);
FITYK_API std::string get_file_basename(std::string const& path);

/// dataset
class Data
class FITYK_API Data
{
public :
static int count_blocks(const std::string& fn,
Expand Down
1 change: 1 addition & 0 deletions fityk/eparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

/// Data expression parser.

#define BUILDING_LIBFITYK
#include "eparser.h"

#include <cstring>
Expand Down
2 changes: 1 addition & 1 deletion fityk/eparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class AggregFunc
/// Expression parser.
/// Derived from ExpressionParser only because it is handy to keep both
/// in one class.
class ExpressionParser : public ExprCalculator
class FITYK_API ExpressionParser : public ExprCalculator
{
public:
enum ExpectedType
Expand Down
4 changes: 3 additions & 1 deletion fityk/fit.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// This file is part of fityk program. Copyright (C) Marcin Wojdyr
// Licence: GNU General Public License ver. 2+

#define BUILDING_LIBFITYK
#include "fit.h"

#include <algorithm>
#include <math.h>
#include <string.h>
#include <boost/math/distributions/students_t.hpp>

#include "fit.h"
#include "logic.h"
#include "model.h"
#include "data.h"
Expand Down
6 changes: 3 additions & 3 deletions fityk/fit.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Ftk;
class Variable;

/// interface of fitting method and implementation of common functions
class Fit
class FITYK_API Fit
{
public:
const std::string name;
Expand Down Expand Up @@ -100,7 +100,7 @@ class Fit
};

/// handles parameter history
class ParameterHistoryMgr
class FITYK_API ParameterHistoryMgr
{
public:
ParameterHistoryMgr(Ftk *F) : F_(F), param_hist_ptr_(0) {}
Expand All @@ -123,7 +123,7 @@ class ParameterHistoryMgr

/// gives access to fitting methods, enables swithing between them
/// also stores parameter history
class FitMethodsContainer : public ParameterHistoryMgr
class FITYK_API FitMethodsContainer : public ParameterHistoryMgr
{
public:
static const char* full_method_names[][2];
Expand Down
5 changes: 4 additions & 1 deletion fityk/fityk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

/// implementation of libfityk public API

#define BUILDING_LIBFITYK
#include "fityk.h"

#include <cassert>
#include <cctype>
#include <cstring>
#include "fityk.h"

#include "common.h"
#include "ui.h"
#include "logic.h"
Expand Down
Loading

0 comments on commit 352f6b5

Please sign in to comment.