mirror of
https://github.com/postgres/postgres.git
synced 2025-12-15 02:22:24 +03:00
Add various widely useful "IWYU pragma" annotations, such as - Common header files such as c.h, postgres.h should be "always_keep". - System headers included in c.h, postgres.h etc. should be considered "export". - Some portability headers such as getopt_long.h should be "always_keep", so they are not considered superfluous on some platforms. - Certain system headers included from portability headers should be considered "export" because the purpose of the portability header is to wrap them. - Superfluous includes marked as "for backward compatibility" get a formal IWYU annotation. - Generated header included in utils/syscache.h is marked exported. This is a very commonly used include and this avoids lots of complaints. Discussion: https://www.postgresql.org/message-id/flat/9395d484-eff4-47c2-b276-8e228526c8ae@eisentraut.org
38 lines
756 B
C
38 lines
756 B
C
/*
|
|
* Portions Copyright (c) 1987, 1993, 1994
|
|
* The Regents of the University of California. All rights reserved.
|
|
*
|
|
* Portions Copyright (c) 2003-2025, PostgreSQL Global Development Group
|
|
*
|
|
* src/include/getopt_long.h
|
|
*/
|
|
/* IWYU pragma: always_keep */
|
|
#ifndef GETOPT_LONG_H
|
|
#define GETOPT_LONG_H
|
|
|
|
#include "pg_getopt.h" /* IWYU pragma: export */
|
|
|
|
#ifndef HAVE_STRUCT_OPTION
|
|
|
|
struct option
|
|
{
|
|
const char *name;
|
|
int has_arg;
|
|
int *flag;
|
|
int val;
|
|
};
|
|
|
|
#define no_argument 0
|
|
#define required_argument 1
|
|
#define optional_argument 2
|
|
#endif
|
|
|
|
#ifndef HAVE_GETOPT_LONG
|
|
|
|
extern int getopt_long(int argc, char *const argv[],
|
|
const char *optstring,
|
|
const struct option *longopts, int *longindex);
|
|
#endif
|
|
|
|
#endif /* GETOPT_LONG_H */
|