Previously it was interpreted as number of bytes, while the
documentation stated that it was the number of 8 byte blocks.
This makes it behave similarly to the existing AES code.
Signed-off-by: Martin Storsjö <martin@martin.st>
Previously it was interpreted as number of bytes, while the
documentation stated that it was the number of 8 byte blocks.
This makes it behave similarly to the existing AES code.
Signed-off-by: Martin Storsjö <martin@martin.st>
intfloat.h is a public header, and is now (since a1245d5ca) included
by mathematics.h, which many external callers include.
This fixes building third party applications that include
mathematics.h in a language that doesn't support designated
initalizers.
Signed-off-by: Martin Storsjö <martin@martin.st>
These files use NAN/INFINITY but didn't include mathematics.h to get
the fallback definitions if the system lacks the macros.
Signed-off-by: Martin Storsjö <martin@martin.st>
Some compilers, MSVC among them, don't recognize the divisions by
zero as meaning infinity/nan.
These macros should, according to the standard, expand to constant
expressions, but this shouldn't matter for our usage.
Signed-off-by: Martin Storsjö <martin@martin.st>
This adds macros for accessing the EFLAGS register and uses
these instead of coding the entire check in inline asm.
Signed-off-by: Mans Rullgard <mans@mansr.com>
This creates proper position independent code when accessing
data symbols if CONFIG_PIC is set.
References to external symbols should now use the movrelx macro.
Some additional code changes are required since this macro may
need a register to hold the GOT pointer.
Signed-off-by: Mans Rullgard <mans@mansr.com>
unistd.h is used for open/read/close, but if this header does not
exist, there's probably no use in trying to open /dev/*random
at all.
Signed-off-by: Martin Storsjö <martin@martin.st>
This adds a fallback for cbrtf() using powf(x, 1/3). Since
powf() with a non-integer exponent requires a non-negative
base, special handling of negative inputs is needed.
Signed-off-by: Mans Rullgard <mans@mansr.com>
This is required for isatty, which exists on MSVC and is found by
configure, but is provided by io.h instead of unistd.h.
Signed-off-by: Martin Storsjö <martin@martin.st>
This adds whitespace around operators, aligns line continuation
backslashes, and breaks long lines. Also fixes an ifdef halfway
through a statement. The one line of duplication this saved is
not worth the ugliness.
Signed-off-by: Mans Rullgard <mans@mansr.com>
MSVC has isatty (in io.h), but not unistd.h. (isatty isn't called
at all for windows, since there's a special case block for that.)
Signed-off-by: Martin Storsjö <martin@martin.st>
This function implements a delay using the first available
of the following functions:
- nanosleep()
- usleep()
- Sleep() (Windows)
The conditional #includes in time.c are simplified by including
unistd.h and windows.h whenever they are available rather than
having these lines triggered by specific functions.
Signed-off-by: Mans Rullgard <mans@mansr.com>
The unistd.h header is only needed for the close() declaration.
If this header is not available, the close() declaration may be
provided by another header, e.g. io.h.
Signed-off-by: Mans Rullgard <mans@mansr.com>
The only symbol this file uses from unistd.h is isatty(). By
including the header only when this function is used, the file
can be built on systems without unistd.h (which presumably also
lack isatty).
Signed-off-by: Mans Rullgard <mans@mansr.com>