mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14: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.classlib.java.lang.TSystem;
|
||||||
import org.teavm.interop.Import;
|
import org.teavm.interop.Import;
|
||||||
import org.teavm.interop.NoSideEffects;
|
import org.teavm.interop.NoSideEffects;
|
||||||
|
import org.teavm.interop.Platforms;
|
||||||
import org.teavm.interop.Unmanaged;
|
import org.teavm.interop.Unmanaged;
|
||||||
|
import org.teavm.interop.UnsupportedOn;
|
||||||
import org.teavm.jso.core.JSDate;
|
import org.teavm.jso.core.JSDate;
|
||||||
|
|
||||||
public class TDate implements TComparable<TDate> {
|
public class TDate implements TComparable<TDate> {
|
||||||
|
@ -36,6 +38,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
|
|
||||||
@Import(name = "teavm_date_init")
|
@Import(name = "teavm_date_init")
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
private static native void initLowLevel();
|
private static native void initLowLevel();
|
||||||
|
@ -72,6 +75,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native long initDateLowLevel(int year, int month, int date, int hrs, int min, int sec);
|
private static native long initDateLowLevel(int year, int month, int date, int hrs, int min, int sec);
|
||||||
|
|
||||||
public TDate(String s) {
|
public TDate(String s) {
|
||||||
|
@ -96,6 +100,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native long initUtcDateLowLevel(int year, int month, int date, int hrs, int min, int sec);
|
private static native long initUtcDateLowLevel(int year, int month, int date, int hrs, int min, int sec);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -115,6 +120,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native long parseLowLevel(String s);
|
private static native long parseLowLevel(String s);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -129,6 +135,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int getYearLowLevel(long date);
|
private static native int getYearLowLevel(long date);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -146,6 +153,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native long setYearLowLevel(long date, int year);
|
private static native long setYearLowLevel(long date, int year);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -160,6 +168,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int getMonthLowLevel(long date);
|
private static native int getMonthLowLevel(long date);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -177,6 +186,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native long setMonthLowLevel(long date, int month);
|
private static native long setMonthLowLevel(long date, int month);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -191,6 +201,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int getDateLowLevel(long date);
|
private static native int getDateLowLevel(long date);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -208,6 +219,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int setDateLowLevel(long target, int date);
|
private static native int setDateLowLevel(long target, int date);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -219,6 +231,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Import(name = "teavm_date_getDay")
|
@Import(name = "teavm_date_getDay")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
public static native int getDayLowLevel(long date);
|
public static native int getDayLowLevel(long date);
|
||||||
|
|
||||||
|
@ -234,6 +247,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int getHoursLowLevel(long date);
|
private static native int getHoursLowLevel(long date);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -251,6 +265,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int setHoursLowLevel(long date, int hours);
|
private static native int setHoursLowLevel(long date, int hours);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -265,6 +280,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int getMinutesLowLevel(long date);
|
private static native int getMinutesLowLevel(long date);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -282,6 +298,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int setMinutesLowLevel(long date, int minutes);
|
private static native int setMinutesLowLevel(long date, int minutes);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -296,6 +313,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int getSecondsLowLevel(long date);
|
private static native int getSecondsLowLevel(long date);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -313,6 +331,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@Unmanaged
|
@Unmanaged
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native int setSecondsLowLevel(long date, int seconds);
|
private static native int setSecondsLowLevel(long date, int seconds);
|
||||||
|
|
||||||
public long getTime() {
|
public long getTime() {
|
||||||
|
@ -362,6 +381,7 @@ public class TDate implements TComparable<TDate> {
|
||||||
@Import(name = "teavm_date_format")
|
@Import(name = "teavm_date_format")
|
||||||
@NoSideEffects
|
@NoSideEffects
|
||||||
@RuntimeInclude("date.h")
|
@RuntimeInclude("date.h")
|
||||||
|
@UnsupportedOn(Platforms.WEBASSEMBLY)
|
||||||
private static native String toStringLowLevel(long date);
|
private static native String toStringLowLevel(long date);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|
Loading…
Reference in New Issue
Block a user