Name

SPVM::Sys::OS - System Calls for OS

Description

SPVM::Sys::OS is the Sys::OS class in SPVM language. It provides system calls for OS.

Usage

use Sys::OS;

my $is_windows = Sys::OS->defined("_WIN32");

Class Methods

defined

static method defined : int ($macro_name : string, $value_ref = undef : object of int[]|long[]|double[])

Checks if the macro in the C langauge is defined. If the macro is defined, returns 1. Otherwise returns 0.

If $value_ref is specifed and $macro_name is defined, the macro value converted to the given type is set to the first element of the $value_ref.

Supports the following macro names.

  • __GNUC__

  • __clang__

  • __BORLANDC__

  • __INTEL_COMPILER

  • __unix

  • __unix__

  • __linux

  • __linux__

  • __FreeBSD__

  • __NetBSD__

  • __OpenBSD__

  • _WIN32

  • WIN32

  • _WIN64

  • _WINDOWS

  • _CONSOLE

  • WINVER

  • _WIN32_WINDOWS

  • _WIN32_WINNT

  • WINCEOSVER

  • __CYGWIN__

  • __CYGWIN32__

  • __MINGW32__

  • __MINGW64__

  • __APPLE__

  • __MACH__

  • __sun

  • __solaris

is_windows

static method is_windows : int ();

If the OS is Windows, returns 1, otherwise returns 0.

Modules

All modules that is included in this distribution.

Author

Yuki Kimoto(https://github.com/yuki-kimoto)

Contributors

Gabor Szabo(https://github.com/szabgab)

Repository

SPVM::Sys::OS - Github

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License