postgresql/src/port
Peter Eisentraut 555eb1a4f0 Remove obsolete ifdefs
Commit 8dace66e07 added #ifdefs for a
number of errno symbols because they were not present on Windows.
Later, commit 125ad539a2 added
replacement #defines for some of those symbols.  So some of the
changes from the first commit are made dead code by the second commit
and can now be removed.

Discussion: https://www.postgresql.org/message-id/flat/6dee8574-b0ad-fc49-9c8c-2edc796f0033@2ndquadrant.com
2020-10-21 14:23:04 +02:00
..
.gitignore
chklocale.c Be more careful about extracting encoding from locale strings on Windows. 2020-03-30 11:14:58 -04:00
dirent.c Add d_type to our Windows dirent emulation. 2020-09-07 23:38:19 +12:00
dirmod.c Fix our Windows stat() emulation to handle file sizes > 4GB. 2020-10-09 16:20:12 -04:00
dlopen.c
erand48.c
explicit_bzero.c Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
fls.c
getaddrinfo.c Fix -Wcast-function-type warnings on Windows/MinGW 2020-10-21 08:17:51 +02:00
getopt_long.c Fix our getopt_long's behavior for a command line argument of just "-". 2020-03-23 11:58:00 -04:00
getopt.c
getpeereid.c
getrusage.c
gettimeofday.c
inet_aton.c
inet_net_ntop.c
kill.c
link.c
Makefile Remove arbitrary restrictions on password length. 2020-09-03 20:09:18 -04:00
mkdtemp.c
noblock.c
open.c
path.c
pg_bitutils.c
pg_crc32c_armv8_choose.c
pg_crc32c_armv8.c
pg_crc32c_sb8.c
pg_crc32c_sse42_choose.c
pg_crc32c_sse42.c
pg_strong_random.c Remove optimization for RAND_poll() failing. 2020-07-25 14:50:59 -07:00
pgcheckdir.c
pgmkdirp.c
pgsleep.c
pgstrcasecmp.c
pgstrsignal.c
pqsignal.c
pread.c
pthread-win32.h
pwrite.c
qsort_arg.c Get rid of trailing semicolons in C macro definitions. 2020-05-01 17:28:00 -04:00
qsort.c Get rid of trailing semicolons in C macro definitions. 2020-05-01 17:28:00 -04:00
quotes.c
random.c Clear some style deviations. 2020-05-21 08:31:16 -07:00
README
snprintf.c Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00
srandom.c
strerror.c Remove obsolete ifdefs 2020-10-21 14:23:04 +02:00
strlcat.c
strlcpy.c
strnlen.c
strtof.c
system.c
tar.c
thread.c
unsetenv.c
win32.ico
win32env.c Fix -Wcast-function-type warnings on Windows/MinGW 2020-10-21 08:17:51 +02:00
win32error.c
win32security.c
win32setlocale.c
win32stat.c Fix -Wcast-function-type warnings on Windows/MinGW 2020-10-21 08:17:51 +02:00
win32ver.rc Remove win32ver.rc from version_stamp.pl 2020-03-10 11:21:41 +01:00

src/port/README

libpgport
=========

libpgport must have special behavior.  It supplies functions to both
libraries and applications.  However, there are two complexities:

1)  Libraries need to use object files that are compiled with exactly
the same flags as the library.  libpgport might not use the same flags,
so it is necessary to recompile the object files for individual
libraries.  This is done by removing -lpgport from the link line:

        # Need to recompile any libpgport object files
        LIBS := $(filter-out -lpgport, $(LIBS))

and adding infrastructure to recompile the object files:

        OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
                connect.o misc.o path.o exec.o \
                $(filter strlcat.o, $(LIBOBJS))

The problem is that there is no testing of which object files need to be
added, but missing functions usually show up when linking user
applications.

2) For applications, we use -lpgport before -lpq, so the static files
from libpgport are linked first.  This avoids having applications
dependent on symbols that are _used_ by libpq, but not intended to be
exported by libpq.  libpq's libpgport usage changes over time, so such a
dependency is a problem.  Windows, Linux, and macOS use an export list to
control the symbols exported by libpq.