local ffi = require("ffi")

if system_information.os == "windows" then
    ffi.cdef [[
        int MessageBeep(unsigned int uType);
    ]]

    on_fail_all(function()
        ffi.C.MessageBeep(0x10) -- 0x10 is the type for the 'Error' beep
    end)
elseif system_information.os == "linux" or system_information.os == "osx" then
    ffi.cdef [[
        int write(int fd, const void *buf, size_t count);
    ]]

    on_fail_all(function()
        ffi.C.write(1, ffi.cast("const char*", "\007"), 1) -- ASCII bell character
    end)
else
    error("error beep is not supported on " .. system_information.os)
end
