Commit Graph

7 Commits

Author SHA1 Message Date
Peter Wang
544f3bf095 Use musl getopt implementation.
LICENSE:
    Mention files derived from musl library.

runtime/process_getopt:
    Process files from ../getopt/*.[ch] to produce
    mercury_getopt.h, mercury_getopt.c, mercury_getopt_long.c.

runtime/mercury_getopt.h:
runtime/mercury_getopt.c:
runtime/mercury_getopt_long.c:
    Add files generated by process_getopt.

runtime/Mmakefile:
    Update list of source files.

util/Mmakefile:
    Use musl getopt if the system C library does not have getopt().

tests/debugger/browser_test.exp:
tests/debugger/browser_test.exp2:
tests/debugger/browser_test.exp3:
tests/hard_coded/runtime_opt.exp:
    Update expected error messages to match new getopt() output.

changed exp output
2019-06-10 13:30:49 +10:00
Peter Wang
3162997f14 Delete GNU getopt implementation.
runtime/GETOPT/getopt.c:
runtime/GETOPT/getopt.h:
runtime/GETOPT/getopt1.c:
runtime/mercury_getopt.c:
runtime/mercury_getopt.h:
runtime/mercury_getopt1.c:
    Delete files.

runtime/RESERVED_MACRO_NAMES:
    Delete __GNU_LIBRARY__ macro.
2019-06-10 13:30:43 +10:00
Julien Fischer
d871f74da9 Don't use MR_GNUC here since we don't #include the usual
Branches: main, 11.07

runtime/mercury_getopt.c:
	Don't use MR_GNUC here since we don't #include the usual
	Mercury headers here and it will always be undefined.
2011-08-09 11:07:37 +00:00
Julien Fischer
8af00f7a2a Avoid using the __GNUC__ macro in the runtime as a test for the presence of
Branches: main, 11.07

Avoid using the __GNUC__ macro in the runtime as a test for the presence of
gcc, since clang also defines that macro.  Since clang doesn't support all
of the GNU C extensions, we can't actually use __GNUC__ without also checking
whether we are actually using clang.

runtime/mercury_conf_param.h:
	Add three new macros, MR_CLANG, MR_GNUC and MR_MSVC that are defined
	only when the C compiler is clang, gcc, or Visual C respectively.
	(In particular, MR_GNUC will _not_ be defined when the C compiler
	is clang.)

runtime/mercury.c:
runtime/mercury.h:
runtime/mercury_atomic_ops.c:
runtime/mercury_atomic_ops.h
runtime/mercury_bitmap.h:
runtime/mercury_float.h:
runtime/mercury_getopt.c:
runtime/mercury_goto.h:
runtime/mercury_heap.h:
runtime/mercury_std.h:
	Replace uses of the __GNUC__ and __clang__ macros with the above.

runtime/mercury_regs.h:
	As above, also #include mercury_conf_param.h directly since
	this file is #included by some of the tests in the configure
	script.
2011-08-01 07:06:21 +00:00
Fergus Henderson
0a95ede8eb Delete extraneous `MR_' prefixes in comments,
Estimated hours taken: 0.5
Branches: main

runtime/mercury_getopt.h:
runtime/mercury_getopt.c:
runtime/mercury_getopt1.c:
	Delete extraneous `MR_' prefixes in comments,
	that were apparently added by an overzealous sed script.
2002-02-05 10:19:06 +00:00
Fergus Henderson
1017dd546a Add braces around body of `if' statement, to suppress gcc warning.
Estimated hours taken: 0.1

runtime/mercury_getopt.c:
	Add braces around body of `if' statement, to suppress gcc warning.
1999-10-15 17:17:21 +00:00
Zoltan Somogyi
45bdceb363 Add the files as produced by process_getopt.
Estimated hours taken: 1

runtime/mercury_getopt.c:
runtime/mercury_getopt1.c:
	Add the files as produced by process_getopt.

runtime/process_getopt:
runtime/mercury_getopt.h:
	Avoid a warning if the environment already defines __GNU_LIBRARY__,
	and prevent this from omitting the entire bodies of the source files
	:-(.

util/getopt.h:
	A copy of the old mercury_getopt.h for mkinit.c

util/mkinit.c:
	Include getopt.h instead of mercury_getopt.h, since we want getopt(),
	not MR_getopt().
1998-08-11 06:23:29 +00:00