mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 00:04:10 -08:00
mark certain features of Date unsupported on wasm
this gives much clearer feedback, at build time rather than runtime, when attempting to use TeaVM with code that uses these operations.
This commit is contained in:
parent
ec21f2d8e1
commit
2d1bc6c956
|
@ -22,7 +22,9 @@ import org.teavm.classlib.java.lang.TComparable;
|
|||
import org.teavm.classlib.java.lang.TSystem;
|
||||
import org.teavm.interop.Import;
|
||||
import org.teavm.interop.NoSideEffects;
|
||||
import org.teavm.interop.Platforms;
|
||||
import org.teavm.interop.Unmanaged;
|
||||
import org.teavm.interop.UnsupportedOn;
|
||||
import org.teavm.jso.core.JSDate;
|
||||
|
||||
public class TDate implements TComparable<TDate> {
|
||||
|
@ -36,6 +38,7 @@ public class TDate implements TComparable<TDate> {
|
|||
|
||||
@Import(name = "teavm_date_init")
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
@NoSideEffects
|
||||
@Unmanaged
|
||||
private static native void initLowLevel();
|
||||
|
@ -72,6 +75,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native long initDateLowLevel(int year, int month, int date, int hrs, int min, int sec);
|
||||
|
||||
public TDate(String s) {
|
||||
|
@ -96,6 +100,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native long initUtcDateLowLevel(int year, int month, int date, int hrs, int min, int sec);
|
||||
|
||||
@Deprecated
|
||||
|
@ -115,6 +120,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native long parseLowLevel(String s);
|
||||
|
||||
@Deprecated
|
||||
|
@ -129,6 +135,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int getYearLowLevel(long date);
|
||||
|
||||
@Deprecated
|
||||
|
@ -146,6 +153,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native long setYearLowLevel(long date, int year);
|
||||
|
||||
@Deprecated
|
||||
|
@ -160,6 +168,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int getMonthLowLevel(long date);
|
||||
|
||||
@Deprecated
|
||||
|
@ -177,6 +186,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native long setMonthLowLevel(long date, int month);
|
||||
|
||||
@Deprecated
|
||||
|
@ -191,6 +201,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int getDateLowLevel(long date);
|
||||
|
||||
@Deprecated
|
||||
|
@ -208,6 +219,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int setDateLowLevel(long target, int date);
|
||||
|
||||
@Deprecated
|
||||
|
@ -219,6 +231,7 @@ public class TDate implements TComparable<TDate> {
|
|||
}
|
||||
|
||||
@Import(name = "teavm_date_getDay")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
@Unmanaged
|
||||
public static native int getDayLowLevel(long date);
|
||||
|
||||
|
@ -234,6 +247,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int getHoursLowLevel(long date);
|
||||
|
||||
@Deprecated
|
||||
|
@ -251,6 +265,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int setHoursLowLevel(long date, int hours);
|
||||
|
||||
@Deprecated
|
||||
|
@ -265,6 +280,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int getMinutesLowLevel(long date);
|
||||
|
||||
@Deprecated
|
||||
|
@ -282,6 +298,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int setMinutesLowLevel(long date, int minutes);
|
||||
|
||||
@Deprecated
|
||||
|
@ -296,6 +313,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int getSecondsLowLevel(long date);
|
||||
|
||||
@Deprecated
|
||||
|
@ -313,6 +331,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@NoSideEffects
|
||||
@Unmanaged
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native int setSecondsLowLevel(long date, int seconds);
|
||||
|
||||
public long getTime() {
|
||||
|
@ -362,6 +381,7 @@ public class TDate implements TComparable<TDate> {
|
|||
@Import(name = "teavm_date_format")
|
||||
@NoSideEffects
|
||||
@RuntimeInclude("date.h")
|
||||
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||
private static native String toStringLowLevel(long date);
|
||||
|
||||
@Deprecated
|
||||
|
|
Loading…
Reference in New Issue
Block a user