Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop to main for 2023.12.17 #43

Merged
merged 10 commits into from
Dec 13, 2023
57 changes: 2 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,8 @@ on:
pull_request:

jobs:
build-on-ubuntu1804:
runs-on: ubuntu-18.04
env:
RUNS_ON: ubuntu1804
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
with:
cmake-version: '3.24.x'
- name: Test cmake version
run: cmake --version
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
freeglut3-dev \
g++ \
libcurl4-openssl-dev \
libfontconfig-dev \
libgl1-mesa-dev \
libgtk2.0-dev \
mesa-common-dev \
unzip
- name: Get GCC version
run: gcc --version
- name: Get libc version
run: ldd --version

- name: Install wxWidgets
run: |
sudo apt-get install -y libwxgtk*-dev
sudo ln -s $(which wx-config) /usr/local/bin/wx-config-3
wx-config-3 --cflags | grep I

- name: Checkout
uses: actions/checkout@v2

- name: Build LK
run: |
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
cmake --build build_linux -- -j

- name: Save static lib & lksandbox
uses: actions/upload-artifact@v2
with:
name: LK-${{ env.RUNS_ON }}-x86_64
path: |
build_linux/lk_sandbox*
build_linux/lk*.a

build-on-ubuntu2004:
runs-on: ubuntu-20.04
env:
RUNS_ON: ubuntu2004
build-on-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
Expand Down
29 changes: 29 additions & 0 deletions include/lk/absyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,42 @@ typedef wxStringEqual lk_string_equal;

#else
#include <string>
#include <sstream>

typedef std::string::value_type lk_char;
typedef std::string lk_string;

typedef std::hash<std::string> lk_string_hash;
typedef std::equal_to<std::string> lk_string_equal;

inline lk_string& operator << (lk_string& a, const lk_string& lstr)
{
a += lstr;
return a;
}

inline lk_string& operator << (lk_string& a, const char* s)
{
a += s;
return a;
}

inline lk_string& operator << (lk_string& a, int i)
{
std::stringstream sstr;
sstr << i;
a += sstr.str();
return a;
}

inline lk_string& operator << (lk_string& a, size_t i)
{
std::stringstream sstr;
sstr << i;
a += sstr.str();
return a;
}

#endif

#define lk_tr(s) lk::get_translation(s)
Expand Down
5 changes: 5 additions & 0 deletions include/lk/stdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __lk_stdlib_h
#define __lk_stdlib_h

#ifdef LK_USE_WXWIDGETS
#include <wx/wx.h>
#endif

#include <lk/env.h>

Expand Down Expand Up @@ -169,6 +171,8 @@ namespace lk {
double erfc(double x);
};

#ifdef LK_USE_WXWIDGETS

class MyMessageDialog : public wxDialog {
public:
MyMessageDialog(wxWindow *parent,
Expand Down Expand Up @@ -261,5 +265,6 @@ DECLARE_EVENT_TABLE();
};

wxWindow *GetCurrentTopLevelWindow();
#endif

#endif
2 changes: 2 additions & 0 deletions src/stdlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4105,6 +4105,7 @@ double lk::erfc(double x) {
return x < 0.0 ? 1.0 + gammp(0.5, x * x) : gammq(0.5, x * x);
}

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

return 0;
}
#endif

#ifdef WIN32

Expand Down
Loading