mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 22:35:41 +00:00
Delete util/getopt.h
util/getopt.h:
Delete this file.
util/Mmakefile:
Pass -I../getopt to the C compiler.
util/mkinit.c:
util/mkinit_erl.c:
Include either <unistd.h> or ../getopt/getopt.h for the declaration
of getopt(). We don't include both in case there may be conflicting
declarations of getopt() on some system.
This commit is contained in:
@@ -18,8 +18,7 @@ include $(MERCURY_DIR)/Mmake.common
|
|||||||
|
|
||||||
#-----------------------------------------------------------------------------#
|
#-----------------------------------------------------------------------------#
|
||||||
|
|
||||||
# We need -I$(RUNTIME_DIR) for "mercury_std.h", etc.
|
CFLAGS = -I$(RUNTIME_DIR) -I../getopt
|
||||||
CFLAGS = -I$(RUNTIME_DIR)
|
|
||||||
|
|
||||||
PROGS=mkinit mkinit_erl mdemangle mfiltercc info_to_mdb
|
PROGS=mkinit mkinit_erl mdemangle mfiltercc info_to_mdb
|
||||||
PROGFILENAMES=$(PROGS:%=%$(EXT_FOR_EXE))
|
PROGFILENAMES=$(PROGS:%=%$(EXT_FOR_EXE))
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
** Copyright (C) 1993-1997 The University of Melbourne.
|
|
||||||
** This file may only be copied under the terms of the GNU Library General
|
|
||||||
** Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
** mercury_getopt.h - declares the interface to the system function getopt()
|
|
||||||
**
|
|
||||||
** We use this file rather than the system's <getopt.h>
|
|
||||||
** because different systems have different ideas about
|
|
||||||
** where the `const's should go on the declaration of getopt().
|
|
||||||
** Also, some systems might have getopt() but not <getopt.h>.
|
|
||||||
** According to POSIX, getopt() is declared in <unistd.h>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MERCURY_UTIL_GETOPT_H
|
|
||||||
#define MERCURY_UTIL_GETOPT_H
|
|
||||||
|
|
||||||
#define GETOPTHUH '?'
|
|
||||||
#define GETOPTDONE (-1)
|
|
||||||
|
|
||||||
extern int getopt(int, char *const*, const char *);
|
|
||||||
|
|
||||||
extern char *optarg;
|
|
||||||
extern int opterr;
|
|
||||||
extern int optind;
|
|
||||||
extern int optopt;
|
|
||||||
|
|
||||||
#endif /* not MERCURY_UTIL_GETOPT_H */
|
|
||||||
@@ -39,7 +39,6 @@
|
|||||||
/* mercury_std.h includes mercury_regs.h, and must precede system headers */
|
/* mercury_std.h includes mercury_regs.h, and must precede system headers */
|
||||||
#include "mercury_conf.h"
|
#include "mercury_conf.h"
|
||||||
#include "mercury_std.h"
|
#include "mercury_std.h"
|
||||||
#include "getopt.h"
|
|
||||||
#include "mercury_array_macros.h"
|
#include "mercury_array_macros.h"
|
||||||
#include "mkinit_common.h"
|
#include "mkinit_common.h"
|
||||||
|
|
||||||
@@ -55,6 +54,8 @@
|
|||||||
|
|
||||||
#ifdef MR_HAVE_UNISTD_H
|
#ifdef MR_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#else
|
||||||
|
#include "getopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* --- adjustable limits --- */
|
/* --- adjustable limits --- */
|
||||||
|
|||||||
@@ -52,6 +52,8 @@
|
|||||||
|
|
||||||
#ifdef MR_HAVE_UNISTD_H
|
#ifdef MR_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#else
|
||||||
|
#include "getopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|||||||
Reference in New Issue
Block a user