Commit graph

32 commits

Author SHA1 Message Date
H. Peter Anvin
eaa68f1c85 Add strlcpy() function
Add strlcpy() function and implementation, and use configure to detect
if strlcpy() is natively available on the system.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-08-10 15:59:34 -07:00
H. Peter Anvin
1fb908c0db autoconf: detect the broken bool in OpenWatcom 1.8
OpenWatcom 1.8 has a C99 mode, which implements _Bool and
<stdbool.h>.  Unfortunately the implementation is broken, and doesn't
let _Bool be implicitly converted to integer (as required by the C99
spec).  Detect this case in autoconf.
2009-03-01 13:57:40 -08:00
H. Peter Anvin
eec3b52505 doc: for ps to pdf conversion, use "acrodist", "ps2pdf" or "pstopdf"
For PostScript to PDF conversion, use whichever of "acrodist",
"ps2pdf", or "pstopdf" which we can find on the system.  I haven't
tried either acrodist or pstopdf myself, only going my the
documentation, but prefer acrodist since it is claimed to produce
smaller output files than ps2pdf.
2008-06-19 11:39:23 -07:00
H. Peter Anvin
11e6c85b09 Fix typo: s/most/least/
Littleendian = least signficant byte first
2008-06-10 14:41:43 -07:00
H. Peter Anvin
253a4e7a9f Make it possible to use "inline" and "restrict"
Put the appropriate machinery in place to be able to use the "inline"
and "restrict" keywords with appropriate semantics.
2008-06-10 13:00:27 -07:00
H. Peter Anvin
2f0f9ea286 Use autoconf to detect WORDS_LITTLEENDIAN
Use autoconf to detect littleendian word order, and use
WORDS_LITTLEENDIAN instead of X86_MEMORY when we don't require
unaligned memory accesses to be permitted.
2008-06-08 20:53:29 -07:00
H. Peter Anvin
c13d31a907 Better handling of platforms which hide "extended" functionality
Some platforms apparently feel -std=c99, which defines
__STRICT_ANSI__, should also hide a bunch of function prototypes.
This rather sucks.  At least try to deal with it.

MinGW and DJGPP both have this problem, in particular.
2007-10-26 18:49:29 -07:00
H. Peter Anvin
26573020d8 Cleaner solution for MinGW handling of __STRICT_ANSI__
If MinGW is detected, undefine __STRICT_ANSI__ in compiler.h instead.
2007-10-18 19:14:08 -07:00
H. Peter Anvin
8088815922 configure: Undefine __STRICT_ANSI__ for mingw's benefit
mingw makes a bunch of prototypes unavailable if __STRICT_ANSI__ is
defined.  However, they are still detected by configure, which causes
us pain.
2007-10-18 19:14:08 -07:00
H. Peter Anvin
70a5d14b89 autoconf: drop AC_USE_SYSTEM_EXTENSIONS to support autoconf 2.59
AC_USE_SYSTEM_EXTENSIONS requires autoconf 2.61, which is still a
little too new, apparently.  Unless we have a specific reason to
include it, don't.
2007-10-13 23:12:46 -07:00
H. Peter Anvin
6867acc18e Use the compiler-provided booleans if available, otherwise emulate
Both C and C++ have "bool", "true" and "false" in lower case; C
requires <stdbool.h> for this, in C++ it is an inherent type built
into the compiler.  Use those instead of the old macros; emulate with
a simple typedef enum if unavailable.
2007-10-10 14:58:45 -07:00
H. Peter Anvin
38a1b8ae9f configure.in: looks like we need autoconf 2.61 :(
AC_USE_SYSTEM_EXTENSIONS is really, *really* useful, but apparently
requires autoconf 2.61...
2007-10-10 14:29:53 -07:00
H. Peter Anvin
8f303505ea Use autoconf to request feature macros 2007-10-03 17:40:12 -07:00
H. Peter Anvin
fe501957c0 Portability fixes
Concentrate compiler dependencies to compiler.h; make sure compiler.h
is included first in every .c file (since some prototypes may depend
on the presence of feature request macros.)

Actually use the conditional inclusion of various functions (totally
broken in previous releases.)
2007-10-02 21:53:51 -07:00
H. Peter Anvin
a3d1ccd8ab configure.in: AC_SUBST_FILE should have been AC_SUBST
AC_SUBST_FILE happened to work in autoconf 2.59, but is broken in
autoconf 2.61.
2007-09-28 20:17:12 -07:00
H. Peter Anvin
304b605563 Add substitutes for snprintf() and vsnprintf()
To deal with fools^Wpeople trying to keep really old systems alive,
create a proper framework for substitution functions, and make it
possible to deal with the lack of snprintf/vsnprintf in particular.
2007-09-28 10:50:20 -07:00
H. Peter Anvin
b8af9aa522 Cleaner way to handle MSVC's _snprintf() underscore damage
Some versions of MSVC have snprintf() and vsnprintf() only with a
leading underscore.  Handle that a bit more cleanly.
2007-09-17 13:53:14 -07:00
H. Peter Anvin
d105682096 Remove $Id$ tags (useless with git)
Remove CVS $Id$ tags, since git doesn't use them.
2007-09-12 21:05:06 -07:00
H. Peter Anvin
52daec56f9 Detect missing <inttypes.h> and include ersatz version if missing 2007-06-21 19:00:12 +00:00
H. Peter Anvin
1ed0387476 Cleaner way to add gcc options
We can actually test for the options being accepted, rather than try
to test for gcc; this handles differences between gcc versions as well
as compilers with a similar command line set.
2007-04-15 22:45:25 +00:00
H. Peter Anvin
1a4440ac58 When compiling with gcc, compile with -W -Wall for maximum warnings. 2007-04-13 19:59:20 +00:00
H. Peter Anvin
038d861ede Remove obsolete types; add <inttypes.h> where needed; header fixes
- Remove obsolete types like "uint32"; use "uint32_t" consistently.
- Make sure we include <inttypes.h> where needed.
- Header file guards should be FOO_H or SUBDIR_FOO_H; _FOO_H infringes
  on the C implementation's namespace and should only be used when
  writing libc!
- Change a few "int8_t" back to "char" where appropriate.  There are
  a lot more places where that should be done, though.
- Clean up the check for getuid/getgid in rdoff/rdlar.h.
2007-04-12 16:54:50 +00:00
Ed Beroset
a5d2945b7b added checks for vsnprintf and snprintf (ISO C99) and changed gcc
compile flag from -ansi to -std=c99
2004-12-15 23:02:20 +00:00
H. Peter Anvin
eea6b7aa7f Make sure autoheader has actually been run by conditionalizing
the running of configure on the existence of config.h.in.
2003-09-08 20:02:10 +00:00
H. Peter Anvin
2ef2f06125 Enable the use of a config.h file and autoheader. At this point we don't
actually *use* the resulting configuration file, but it keeps autoconf
from creating an insanely long compiler command line, which can cause
problems all by itself.  Eventually we can do:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

... to get the same information.
2003-09-01 04:19:37 +00:00
H. Peter Anvin
1170eb6546 Check in the rest of the Cygwin support patch... 2002-05-19 02:26:38 +00:00
H. Peter Anvin
0fcdadeb55 Fix so that the configure.in works with autoconf 2.5x; make sure
"make cleaner" cleans up all that it needs to clean up
2002-05-19 01:57:54 +00:00
H. Peter Anvin
4b563afc81 Handle separate source and object directories correctly. 2002-05-04 00:15:02 +00:00
H. Peter Anvin
41bf8002b2 NASM 0.98 2002-04-30 20:58:18 +00:00
H. Peter Anvin
ef7468f4ec NASM 0.98p7 2002-04-30 20:57:59 +00:00
H. Peter Anvin
620515ab4e NASM 0.98p6 2002-04-30 20:57:38 +00:00
H. Peter Anvin
87bc61964c NASM 0.97 2002-04-30 20:53:16 +00:00