Skip to content

Commit e5fe92b

Browse files
committed
Merge remote-tracking branch 'funkin/funkin' into cne-master
2 parents d564bf5 + 5932340 commit e5fe92b

22 files changed

Lines changed: 127 additions & 68 deletions

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
arch: 64
4343
sep: /
4444
ext: .dylib
45-
os: macos-13
45+
os: macos-15-intel
4646

4747
MacOSArm:
4848
strategy:

.github/workflows/test.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -147,26 +147,14 @@ jobs:
147147
uses: ./.github/workflows/setup
148148
with:
149149
haxe: ${{ inputs.haxe }}
150-
- name: install mariadb
150+
- name: setup mariadb
151151
if: runner.os == 'Linux'
152152
run: |
153153
set -ex
154-
sudo rm -R /var/lib/mysql/
155-
curl -sSL https://downloads.mariadb.com/MariaDB/mariadb_repo_setup > mariadb_repo_setup
156-
curl -sSL https://downloads.mariadb.com/MariaDB/mariadb_repo_setup.sha256 > mariadb_repo_setup.sha256
157-
sha256sum --check mariadb_repo_setup.sha256
158-
sudo bash mariadb_repo_setup
159154
sudo apt-get update -qqy
160-
sudo apt-get remove -qqy mysql-common
161-
sudo apt-get autoremove -qqy
162155
sudo apt-get install -qqy mariadb-server
163-
- name: configure mariadb
164-
if: runner.os == 'Linux'
165-
run: |
166-
set -ex
167-
sudo systemctl unmask mysql.service
168-
sudo systemctl start mysql
169-
sudo mysql -u root -e "create database hxcpp; grant all privileges on hxcpp.* to hxcpp@localhost identified by 'hxcpp'; flush privileges;"
156+
sudo systemctl start mariadb
157+
sudo mariadb -u root -e "create database hxcpp; grant all privileges on hxcpp.* to hxcpp@localhost identified by 'hxcpp'; flush privileges;"
170158
- name: build
171159
run: haxe compile${{ inputs.arch }}.hxml
172160
- name: run
@@ -227,6 +215,8 @@ jobs:
227215
haxe: ${{ inputs.haxe }}
228216
- name: install haxe libs
229217
run: haxelib install compile-cpp.hxml --always
218+
# haxe 4 tests don't build with latest utest
219+
if: inputs.haxe != 'latest'
230220
- name: build
231221
run: haxe compile-cpp.hxml -D ${{ env.HXCPP_ARCH_FLAG }} -D no_http
232222
- name: run

include/cpp/VirtualArray.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ class VirtualArray : public hx::ObjectPtr<VirtualArray_obj>
3838
inline VirtualArray Add(const T &inVal);
3939

4040

41-
inline bool operator==(const Dynamic &value) const { return value==*this; }
41+
inline bool operator==(const Dynamic &value) const { return value==(Dynamic)*this; }
4242
template<typename SOURCE_> inline bool operator==( const Array<SOURCE_> &inRHS );
4343

44-
inline bool operator!=(Dynamic value) const { return value!=*this; }
44+
inline bool operator!=(Dynamic value) const { return value!=(Dynamic)*this; }
4545
template<typename SOURCE_> inline bool operator!=( const Array<SOURCE_> &inRHS ) { return inRHS!=*this; }
4646

4747
};

include/hxcpp.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,7 @@
6868
#define HXCPP_ALIGN_FLOAT
6969
#endif
7070

71-
// Must allign allocs to 8 bytes to match floating point requirement?
72-
// Ints must br read on 4-byte boundary
73-
#if (!defined(HXCPP_ALIGN_FLOAT) && (defined(EMSCRIPTEN) || defined(GCW0)) )
74-
#define HXCPP_ALIGN_ALLOC
75-
#endif
71+
#define HXCPP_ALIGN_ALLOC
7672

7773

7874
// Some compilers are over-enthusiastic about what they #define ...

src/hx/cppia/Cppia.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3667,8 +3667,10 @@ void genSetter(CppiaCompiler *compiler, const JitVal &ioValue, ExprType exprType
36673667
compiler->mult(ioValue, sJitTempF0, ioValue,true);
36683668
else
36693669
{
3670-
compiler->mult(sJitTempF0, sJitTempF0, ioValue,true);
3671-
compiler->convert(sJitTempF0, etFloat, ioValue, exprType );
3670+
JitTemp fval(compiler, jtFloat);
3671+
compiler->convert(ioValue, exprType, fval, etFloat);
3672+
compiler->mult(sJitTempF0, sJitTempF0, fval, true);
3673+
compiler->convert(sJitTempF0, etFloat, ioValue, exprType);
36723674
}
36733675
}
36743676
break;

src/hx/cppia/Cppia.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,14 @@ struct NAME \
10831083
ioVal = left OP f; \
10841084
return ioVal; \
10851085
} \
1086+
inline static int &run(int &ioVal, hx::CppiaCtx *ctx, hx::CppiaExpr *value) \
1087+
{ \
1088+
int left = ioVal; \
1089+
int i = value->runInt(ctx); \
1090+
BCR_CHECK_RET(ioVal); \
1091+
ioVal = left OP i; \
1092+
return ioVal; \
1093+
} \
10861094
static bool run(bool &ioVal, hx::CppiaCtx *ctx, hx::CppiaExpr *value) { value->runVoid(ctx); return ioVal; } \
10871095
static String run(String &ioVal, hx::CppiaCtx *ctx, hx::CppiaExpr *value) { value->runVoid(ctx); return ioVal; } \
10881096
static hx::Object *run(hx::Object * &ioVal, hx::CppiaCtx *ctx, hx::CppiaExpr *value) \

src/hx/libs/std/Sys.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void _hx_std_put_env( String e, String v )
9999
#ifdef HX_WINRT
100100
// Do nothing
101101
#elif defined(NEKO_WINDOWS)
102-
String set = e + HX_CSTRING("=") + (v != null()?v:"");
102+
String set = e + HX_CSTRING("=") + (v != null()?v:HX_CSTRING(""));
103103

104104
#ifdef HX_SMART_STRINGS
105105
if (set.isUTF16Encoded())

test/cppia/Client.hx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,22 @@ class Client
189189
default:
190190
}
191191

192+
// regression test for #926
193+
var x:Dynamic = 3;
194+
x *= 5;
195+
if (x != 15) {
196+
Common.status = 'Failed regression test for #926. x: $x';
197+
return;
198+
}
199+
200+
// regression test for #1257
201+
var x = 1290555;
202+
x *= 1290555;
203+
if (x != -915102823) {
204+
Common.status = 'Failed regression test for #1257. x: $x';
205+
return;
206+
}
207+
192208
final extending = new ClientExtendedExtendedRoot();
193209

194210
extending.addValue();

toolchain/android-toolchain-clang.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
<set name="EXEPREFIX" value="llvm" />
3636
</section>
3737

38+
<set name="HXCPP_CPP11" value="1" unless="HXCPP_NO_CPP11 || HXCPP_CPP17" />
39+
3840
<include name="toolchain/gcc-toolchain.xml"/>
3941

4042
<compiler id="android-gcc" exe="clang++">
@@ -61,7 +63,9 @@
6163
<flag value="-DHXCPP_ANDROID_PLATFORM=${HXCPP_ANDROID_PLATFORM}" />
6264

6365
<!-- Options -->
66+
<cppflag value="-std=c++11" if="HXCPP_CPP11" />
6467
<cppflag value="-std=c++17" if="HXCPP_CPP17" />
68+
<cppflag value="-std=c++20" if="HXCPP_CPP20" />
6569
<flag value="-flto" if="HXCPP_OPTIMIZE_LINK" unless="debug"/>
6670
<flag value="-fvisibility=hidden"/>
6771
<flag value="-ffunction-sections"/>
@@ -106,6 +110,7 @@
106110
-->
107111
<prefix value="lib"/>
108112
<lib name="-llog"/>
113+
<ext value=".so"/>
109114

110115
</linker>
111116

toolchain/appletvos-toolchain.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<xml>
22

3-
43
<echo value="Using tvOS SDK ${TVOS_VER}" if="VERBOSE"/>
54

5+
<set name="HXCPP_CPP11" value="1" unless="HXCPP_NO_CPP11 || HXCPP_CPP17 || HXCPP_CPP20" />
6+
67
<set name="ARCH" value ="-64" if="HXCPP_ARM64" />
78

89
<set name="HXCPP_USE_LIBTOOL" value="1" />
@@ -25,9 +26,15 @@
2526
<pchflag value="-x" />
2627
<pchflag value="c++-header" />
2728
<cppflag value="-stdlib=libstdc++" if="FORCE_LIBGCC" />
28-
<cppflag value="-stdlib=libc++" if="HXCPP_CPP11" />
29+
<cppflag value="-stdlib=libc++" if="HXCPP_CPP11 || HXCPP_CPP17 || HXCPP_CPP20" />
30+
<cppflag value="-std=c++11" if="HXCPP_CPP11" />
31+
<cppflag value="-std=c++17" if="HXCPP_CPP17" />
32+
<cppflag value="-std=c++20" if="HXCPP_CPP20" />
2933
<mmflag value="-stdlib=libstdc++" if="FORCE_LIBGCC" />
30-
<mmflag value="-stdlib=libc++" if="HXCPP_CPP11" />
34+
<mmflag value="-stdlib=libc++" if="HXCPP_CPP11 || HXCPP_CPP17 || HXCPP_CPP20" />
35+
<mmflag value="-std=c++11" if="HXCPP_CPP11" />
36+
<mmflag value="-std=c++17" if="HXCPP_CPP17" />
37+
<mmflag value="-std=c++20" if="HXCPP_CPP20" />
3138
<flag value="-g" if="HXCPP_DEBUG_LINK"/>
3239
<flag value="-O2" unless="debug"/>
3340
<flag value="-arch"/>
@@ -72,9 +79,9 @@
7279
<exe name="xcrun --sdk appletvos${TVOS_VER} g++" if="HXCPP_GCC" />
7380
<exe name="xcrun --sdk appletvos${TVOS_VER} clang++" />
7481
<cppflag value="-stdlib=libstdc++" if="FORCE_LIBGCC" />
75-
<cppflag value="-stdlib=libc++" if="HXCPP_CPP11" />
82+
<cppflag value="-stdlib=libc++" if="HXCPP_CPP11 || HXCPP_CPP17 || HXCPP_CPP20" />
7683
<mmflag value="-stdlib=libstdc++" if="FORCE_LIBGCC" />
77-
<mmflag value="-stdlib=libc++" if="HXCPP_CPP11" />
84+
<mmflag value="-stdlib=libc++" if="HXCPP_CPP11 || HXCPP_CPP17 || HXCPP_CPP20" />
7885
<flag value="-dynamiclib"/>
7986
<flag value="-arch"/>
8087
<flag value="arm64" if="HXCPP_ARM64" />

0 commit comments

Comments
 (0)