## bit-flags-g.pkg
# Compiled by:
#
src/lib/std/src/standard-core.sublib# This generic is used in:
#
#
src/lib/std/src/psx/posix-io.pkg#
src/lib/std/src/psx/posix-file.pkg#
src/lib/std/src/psx/posix-process.pkg#
src/lib/std/src/psx/posix-tty.pkggeneric package bit_flags_g ()
: Bit_Flags # Bit_Flags is from
src/lib/std/src/bit-flags.api{
package sw
=
host_unt_guts; # host_unt_guts is from
src/lib/std/src/bind-sysword-32.pkg Flags = sw::Unt;
# infix my
| & ;
#
(
|) = sw::bitwise_or;
(&) = sw::bitwise_and;
neg = sw::bitwise_not; # XXX BUGGO FIXME should change this to prefix '!'('~'?) at some point.
fun to_unt x = x;
fun from_unt x = x;
all = -(0u1): Flags;
flags = fold_forward (
|) 0u0;
intersect = fold_forward (&) all;
fun clear (m, x) = x & (neg m);
fun all_set (a, b) = (a
| b) == b;
fun any_set (a, b) = (a & b) != 0u0;
};
## COPYRIGHT (c) 2003 The Fellowship of SML/NJ
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.