Add distance of point to line segment implementation, this was mentioned in the
specification and the declaration was there, just no implemented.
Add test for distance-to-linesegment function
Fix build error with visual studio, it assumes function declarations
inside the body of a class member functions to be in the global
namespace while they should be in the OSL::pvt namespace.
Fix for LLVM 3.2
Fix windows build error due to missing unistd.h and access(). If permissions
are not ok it will throw an error later in parse_file(), so the check is not
needed here.
Fix for building against an older gcc version (< 4.4).
Fix missing includes and math functions when building on windows with mingw
or visual studio. The math functions need #ifdefs because they are macros
on some platforms and functions on others.
Fix another cases where compiler could assert with [] indexing on variables that
don't support it.
Throw compile error for int literals with values outside of the valid range,
instead of silently overflowing.

Also a fix for windows build where there is no unistd.h.
Fix compiler assert when compiling code that does closure color * closure color.
Fix compiler error with /usr/bin/cpp when stdosl.h is in a path with spaces.
Fix compiler error with boost::wave when no stdosl.h path is specified.
Tests for oslc indexing non-array, closure * closure multiplication and
int literal overflow errors.
Windows port: fix build errors in testshade/testrender.
Fix broken exit() function
Windows port: disable RTTI, fix for static boost linking, and don't use
LLVM bitcode for mingw build.
Fix for building from a chroot where the host may be e.g. 64 bit and the target
is 32 bit, we can't use CMAKE_SYSTEM_PROCESSOR and need to ask the compiler.
Fix warnings from clang 3.2
Minimize non-error cmake output, unless VERBOSE=1
Minor improvement to recent exit() fix -- if the shader has no exit() call,
do not generate the extra branch & basic block.

This turns out to be important -- if we put the branch in there
unconditionally, and everything else is optimized away, it no longer looks
like the post-optimized IR is "empty", so the shader isn't flagged as
empty.  When displacement shaders are empty, our renderer handles the
dicing differently.  Hilarity ensues.
Windows port: add OSL_STATIC_LIBRARY define to disable dllimport/dllexport
when using BUILDSTATIC. The application linking against OSL needs to define
this if wants to link against a static OSL library on Windows.

Also fix build errors adding dllimport/dllexport on class members when the
class had them already.