Use constants for the test buffer dimensions
Make sure stride handling is also tested
Wrong padding size calculated (copy-paste error)
Merge branch 'jpeg16' of https://github.com/CendioOssman/tigervnc
Remove unused assert.h include
Make sure we check failed memory allocations
Use the same style for exception messages
Use exceptions rather than asserts for for "normal" errors

Although these are rare, they are still not indicative of bugs so
an exception (which ends up in the log and might also be shown to
the user) is more appropriate than an assert. Asserts should only
be used to catch blatant API misuse and similar.
Merge branch 'assert' of https://github.com/CendioOssman/tigervnc
Don't use MIT-SHM on remote displays.

When run from within 'ssh -X' or 'ssh -Y', MIT-SHM will appear to be
available even though it won't work: the shared memory will be on the
machine running vncviewer, not on the machine running the X server it
displays to. Depending on what shm segments are available on the
machine running the X server, the failure may not be apparent when
checking that MIT-SHM works.

Avoid this by not using MIT-SHM when XDisplayName() indicates we may
not be running locally.

Original bug report:
  https://bugzilla.redhat.com/show_bug.cgi?id=1072733
Clean up GnuTLS linking and instructions

GnuTLS can have different crypto backends, and it is rarely gcrypt
these days. So we should not be including that unconditionally,
and should not be pointing people at it either. Also remove the
section about Win32 binaries as those are out of date and probably
insecure. Lastly remove the section about static builds as it is
a general issue and in no way complete with just the GnuTLS portions.
Remove libjpeg-turbo build instructions

There is nothing special about this library that warrants special
treatment.
Check the return value from XShmAttach.
Link basic X11 libraries last

The extension libraries might depend on libXext or libX11, so
make sure they come last on the link line.
Move ws2_32 dependency to the correct place

It is rdr and network that needs it, not vncviewer.
Add Carbon and Cocoa dependencies to vncviewer

We use both frameworks directly from vncviewer so we should
make sure they get pulled in.
Extend "static" build option

Try to link as much as possible statically in an effort to produce
binaries that can be run everywhere.
Merge branch 'remote-shm' of https://github.com/twaugh/tigervnc
Merge branch 'build' of https://github.com/CendioOssman/tigervnc
Set -DBUILD_STATIC=off for package builds.

Commit f95272d set the BUILD_STATIC flag on by default, which is unnecessary for package builds.