Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-10-28Restore missing line to copyright noticeHeikki Linnakangas
Commit 12c9423832 in May 2003 accidentally removed the last line of the copyright notice in getopt.c. Put it back.
2019-01-18Use our own getopt() on OpenBSD.Tom Lane
Recent OpenBSD (at least 5.9 and up) has a version of getopt(3) that will not cope with the "-:" spec we use to accept double-dash options in postgres.c and postmaster.c. Admittedly, that's a hack because POSIX only requires getopt() to allow alphanumeric option characters. I have no desire to find another way, however, so let's just do what we were already doing on Solaris: force use of our own src/port/getopt.c implementation. In passing, improve some of the comments around said implementation. Per buildfarm and local testing. Back-patch to all supported branches. Discussion: https://postgr.es/m/30197.1547835700@sss.pgh.pa.us
2017-06-21Phase 2 of pgindent updates.Tom Lane
Change pg_bsd_indent to follow upstream rules for placement of comments to the right of code, and remove pgindent hack that caused comments following #endif to not obey the general rule. Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using the published version of pg_bsd_indent, but a hacked-up version that tried to minimize the amount of movement of comments to the right of code. The situation of interest is where such a comment has to be moved to the right of its default placement at column 33 because there's code there. BSD indent has always moved right in units of tab stops in such cases --- but in the previous incarnation, indent was working in 8-space tab stops, while now it knows we use 4-space tabs. So the net result is that in about half the cases, such comments are placed one tab stop left of before. This is better all around: it leaves more room on the line for comment text, and it means that in such cases the comment uniformly starts at the next 4-space tab stop after the code, rather than sometimes one and sometimes two tabs after. Also, ensure that comments following #endif are indented the same as comments following other preprocessor commands such as #else. That inconsistency turns out to have been self-inflicted damage from a poorly-thought-through post-indent "fixup" in pgindent. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21Initial pgindent run with pg_bsd_indent version 2.0.Tom Lane
The new indent version includes numerous fixes thanks to Piotr Stefaniak. The main changes visible in this commit are: * Nicer formatting of function-pointer declarations. * No longer unexpectedly removes spaces in expressions using casts, sizeof, or offsetof. * No longer wants to add a space in "struct structname *varname", as well as some similar cases for const- or volatile-qualified pointers. * Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely. * Fixes bug where comments following declarations were sometimes placed with no space separating them from the code. * Fixes some odd decisions for comments following case labels. * Fixes some cases where comments following code were indented to less than the expected column 33. On the less good side, it now tends to put more whitespace around typedef names that are not listed in typedefs.list. This might encourage us to put more effort into typedef name collection; it's not really a bug in indent itself. There are more changes coming after this round, having to do with comment indentation and alignment of lines appearing within parentheses. I wanted to limit the size of the diffs to something that could be reviewed without one's eyes completely glazing over, so it seemed better to split up the changes as much as practical. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2014-05-06pgindent run for 9.4Bruce Momjian
This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
2014-02-15Centralize getopt-related declarations in a new header file pg_getopt.h.Tom Lane
We used to have externs for getopt() and its API variables scattered all over the place. Now that we find we're going to need to tweak the variable declarations for Cygwin, it seems like a good idea to have just one place to tweak. In this commit, the variables are declared "#ifndef HAVE_GETOPT_H". That may or may not work everywhere, but we'll soon find out. Andres Freund
2011-06-09Pgindent run before 9.1 beta2.Bruce Momjian
2011-04-25Give getopt() a prototype and modern style arg specs.Andrew Dunstan
Welcome to the 1990s.
2010-12-16Remove optreset from src/port/ implementations of getopt and getopt_long.Tom Lane
We don't actually need optreset, because we can easily fix the code to ensure that it's cleanly restartable after having completed a scan over the argv array; which is the only case we need to restart in. Getting rid of it avoids a class of interactions with the system libraries and allows reversion of my change of yesterday in postmaster.c and postgres.c. Back-patch to 8.4. Before that the getopt code was a bit different anyway.
2010-09-20Remove cvs keywords from all files.Magnus Hagander
2009-06-118.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian
provided by Andrew.
2009-04-04Hmm, baiji thinks we need explicit 'extern' here.Tom Lane
2009-04-04Make an attempt at fixing our current Solaris 11 breakage: add a configureTom Lane
probe for opterr (exactly like the one for optreset) and have getopt.c define the variables only if configure doesn't find them in libc.
2007-03-26Remove advertising clause from Berkeley BSD-licensed files, perBruce Momjian
instructions from Berkeley.
2006-03-11Add CVS tag lines to files that were lacking them.Bruce Momjian
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-07-28Fix a whole bunch of #includes that were either wrong or redundant.Tom Lane
The first rule of portability for us is 'thou shalt have no other gods before c.h', and a whole lot of these files were either not including c.h at all, or including random system headers beforehand, either of which sins can mess up largefile support nicely. Once you have included c.h, there is no need to re-include what it includes, either.
2004-10-07Adjust comments previously moved to column 1 by pgident.Bruce Momjian
2004-06-24Include c.h instead of postgres.h in files that need to be usable inTom Lane
both frontend and backend. Per Andreas Pflug.
2003-08-04pgindent run.Bruce Momjian
2003-05-15Allow Win32 to compile under MinGW. Major changes are:Bruce Momjian
Win32 port is now called 'win32' rather than 'win' add -lwsock32 on Win32 make gethostname() be only used when kerberos4 is enabled use /port/getopt.c new /port/opendir.c routines disable GUC unix_socket_group on Win32 convert some keywords.c symbols to KEYWORD_P to prevent conflict create new FCNTL_NONBLOCK macro to turn off socket blocking create new /include/port.h file that has /port prototypes, move out of c.h new /include/port/win32_include dir to hold missing include files work around ERROR being defined in Win32 includes
2003-01-06Use our own version of getopt_long() if the OS doesn't have one.Peter Eisentraut
2002-10-29Update comments.Bruce Momjian
2002-10-29Re-add getopt.c for MSWin psql.Bruce Momjian