Skip to content

Commit

Permalink
avoid including Lua header from wxgui/about.cpp, change year to 2015
Browse files Browse the repository at this point in the history
  • Loading branch information
wojdyr committed Mar 18, 2015
1 parent ffb8f64 commit 8609ae6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ User-visible changes in version 1.3.0 ():
"$a = ~3" keeps domain of $a (also "a={$a}; $a=~{a}" preserves domain)
"$a = ~3 [:]" unsets domain
"$a = copy($x) - copy $x with domain
* new boolean box_constraints options decides if domains are used as box
* new boolean box_constraints option decides if domains are used as box
constraints in fitting methods that support it (default: on)
* GUI: added auto-completion to Lua script editor
* xyConvert is now part of xylib (removed flag --disable-xyconvert)
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
source_encoding = 'utf-8'
master_doc = 'fityk-manual'
project = 'Fityk'
copyright = '2001-2014, Fityk Developers'
copyright = '2001-2015, Fityk Developers'
version = '1.3.0'
release = version
default_role = None
Expand Down
15 changes: 10 additions & 5 deletions fityk/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ extern "C" {

using namespace std;

#ifndef LUA_RELEASE // LUA_RELEASE was added in Lua 5.1.1
#define LUA_RELEASE LUA_VERSION
#endif

namespace fityk {

const char* embedded_lua_version()
{
#ifdef LUA_RELEASE // LUA_RELEASE was added in Lua 5.1.1
return LUA_RELEASE;
#else
return LUA_VERSION;
#endif
}

// get standard formula and make it parsable by the gnuplot program
string& gnuplotize_formula(string& formula)
{
Expand Down Expand Up @@ -145,7 +150,7 @@ string build_info()
+ "." + S(BOOST_VERSION / 100 % 1000)
+ "." + S(BOOST_VERSION % 100)
+ "\nxylib " + xylib_get_version()
+ "\n" LUA_RELEASE
+ "\n" + embedded_lua_version()
#if HAVE_LIBNLOPT
+ "\nNLopt " + S(nl_ver[0]) + "." + S(nl_ver[1]) + "." + S(nl_ver[2])
#endif
Expand Down
2 changes: 2 additions & 0 deletions fityk/info.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace fityk {

std::string build_info();

const char* embedded_lua_version();

/// appends output of the "info" command to the result
int eval_info_args(const Full* F, int ds, const std::vector<Token>& args,
int len, std::string& result);
Expand Down
13 changes: 3 additions & 10 deletions wxgui/about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@

#include "cmn.h" // pchar2wx, s2wx, GET_BMP
#include "fityk/common.h" // VERSION
#include "fityk/info.h" // embedded_lua_version()
#include "img/fityk96.h"

extern "C" {
#include <lua.h> // LUA_RELEASE
}

#ifndef LUA_RELEASE // LUA_RELEASE was added in Lua 5.1.1
#define LUA_RELEASE LUA_VERSION
#endif

AboutDlg::AboutDlg(wxWindow* parent)
: wxDialog(parent, -1, wxT("About Fityk"), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
Expand Down Expand Up @@ -61,11 +54,11 @@ AboutDlg::AboutDlg(wxWindow* parent)
BOOST_VERSION / 100000,
BOOST_VERSION / 100 % 1000,
BOOST_VERSION % 100));
txt->AppendText(pchar2wx(", " LUA_RELEASE));
txt->AppendText(wxString(", ") + fityk::embedded_lua_version());
txt->AppendText(wxT(" and xylib ") + pchar2wx(xylib_get_version())
+ wxT("\n"));
txt->SetDefaultStyle(wxTextAttr(wxNullColour, bg_col, *wxNORMAL_FONT));
txt->AppendText(wxT("\nCopyright 2001 - 2014 Marcin Wojdyr\n\n"));
txt->AppendText(wxT("\nCopyright 2001 - 2015 Marcin Wojdyr\n\n"));
txt->SetDefaultStyle(wxTextAttr(wxNullColour, bg_col, *wxSMALL_FONT));
txt->AppendText(
wxT("This program is free software; you can redistribute it and/or modify ")
Expand Down

0 comments on commit 8609ae6

Please sign in to comment.