Skip to content

Commit c90fcad

Browse files
authored
Merge pull request #43 from NREL/develop
Develop to main for 2023.12.17
2 parents d5f55ff + 91c5608 commit c90fcad

File tree

4 files changed

+38
-55
lines changed

4 files changed

+38
-55
lines changed

.github/workflows/ci.yml

+2-55
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,8 @@ on:
55
pull_request:
66

77
jobs:
8-
build-on-ubuntu1804:
9-
runs-on: ubuntu-18.04
10-
env:
11-
RUNS_ON: ubuntu1804
12-
steps:
13-
- name: Setup cmake
14-
uses: jwlawson/[email protected]
15-
with:
16-
cmake-version: '3.24.x'
17-
- name: Test cmake version
18-
run: cmake --version
19-
- name: Install OS dependencies
20-
run: |
21-
sudo apt-get update
22-
sudo apt-get install -y \
23-
build-essential \
24-
freeglut3-dev \
25-
g++ \
26-
libcurl4-openssl-dev \
27-
libfontconfig-dev \
28-
libgl1-mesa-dev \
29-
libgtk2.0-dev \
30-
mesa-common-dev \
31-
unzip
32-
- name: Get GCC version
33-
run: gcc --version
34-
- name: Get libc version
35-
run: ldd --version
36-
37-
- name: Install wxWidgets
38-
run: |
39-
sudo apt-get install -y libwxgtk*-dev
40-
sudo ln -s $(which wx-config) /usr/local/bin/wx-config-3
41-
wx-config-3 --cflags | grep I
42-
43-
- name: Checkout
44-
uses: actions/checkout@v2
45-
46-
- name: Build LK
47-
run: |
48-
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
49-
cmake --build build_linux -- -j
50-
51-
- name: Save static lib & lksandbox
52-
uses: actions/upload-artifact@v2
53-
with:
54-
name: LK-${{ env.RUNS_ON }}-x86_64
55-
path: |
56-
build_linux/lk_sandbox*
57-
build_linux/lk*.a
58-
59-
build-on-ubuntu2004:
60-
runs-on: ubuntu-20.04
61-
env:
62-
RUNS_ON: ubuntu2004
8+
build-on-ubuntu:
9+
runs-on: ubuntu-latest
6310
steps:
6411
- name: Setup cmake
6512
uses: jwlawson/[email protected]

include/lk/absyn.h

+29
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,42 @@ typedef wxStringEqual lk_string_equal;
6161

6262
#else
6363
#include <string>
64+
#include <sstream>
6465

6566
typedef std::string::value_type lk_char;
6667
typedef std::string lk_string;
6768

6869
typedef std::hash<std::string> lk_string_hash;
6970
typedef std::equal_to<std::string> lk_string_equal;
7071

72+
inline lk_string& operator << (lk_string& a, const lk_string& lstr)
73+
{
74+
a += lstr;
75+
return a;
76+
}
77+
78+
inline lk_string& operator << (lk_string& a, const char* s)
79+
{
80+
a += s;
81+
return a;
82+
}
83+
84+
inline lk_string& operator << (lk_string& a, int i)
85+
{
86+
std::stringstream sstr;
87+
sstr << i;
88+
a += sstr.str();
89+
return a;
90+
}
91+
92+
inline lk_string& operator << (lk_string& a, size_t i)
93+
{
94+
std::stringstream sstr;
95+
sstr << i;
96+
a += sstr.str();
97+
return a;
98+
}
99+
71100
#endif
72101

73102
#define lk_tr(s) lk::get_translation(s)

include/lk/stdlib.h

+5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232
#ifndef __lk_stdlib_h
3333
#define __lk_stdlib_h
3434

35+
#ifdef LK_USE_WXWIDGETS
3536
#include <wx/wx.h>
37+
#endif
3638

3739
#include <lk/env.h>
3840

@@ -169,6 +171,8 @@ namespace lk {
169171
double erfc(double x);
170172
};
171173

174+
#ifdef LK_USE_WXWIDGETS
175+
172176
class MyMessageDialog : public wxDialog {
173177
public:
174178
MyMessageDialog(wxWindow *parent,
@@ -261,5 +265,6 @@ DECLARE_EVENT_TABLE();
261265
};
262266

263267
wxWindow *GetCurrentTopLevelWindow();
268+
#endif
264269

265270
#endif

src/stdlib.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -4105,6 +4105,7 @@ double lk::erfc(double x) {
41054105
return x < 0.0 ? 1.0 + gammp(0.5, x * x) : gammq(0.5, x * x);
41064106
}
41074107

4108+
#ifdef LK_USE_WXWIDGETS
41084109
wxWindow *GetCurrentTopLevelWindow() {
41094110
wxWindowList &wl = ::wxTopLevelWindows;
41104111
for (wxWindowList::iterator it = wl.begin(); it != wl.end(); ++it)
@@ -4114,6 +4115,7 @@ wxWindow *GetCurrentTopLevelWindow() {
41144115

41154116
return 0;
41164117
}
4118+
#endif
41174119

41184120
#ifdef WIN32
41194121

0 commit comments

Comments
 (0)