package netmanager.lib;

import com.sun.jna.IntegerType;
import com.sun.jna.Native;

// LLONG 类型，兼容 32 bits / 64 bits
public class LLONG extends IntegerType {
    private static final long serialVersionUID = 1L;
    public static int size;

    static {
        size = Native.LONG_SIZE;
        String strOsPrefix = PlatUtils.sdk_plat_getOsPrefix();
        if (strOsPrefix.equals("linux-x64") || strOsPrefix.equals("win-x64")) {
            size = 8;
        } else if (strOsPrefix.equals("linux-x86") || strOsPrefix.equals("win-x86")) {
            size = 4;
        }
    }

    /**
     * Create a zero-valued LLONG.
     */
    public LLONG() {
        this(0);
    }

    /**
     * Create a LLONG with the given value.
     */
    public LLONG(long value) {
        super(size, value);
    }
}