build: Enable libc++ std::this_thread::sleep_for if unavailable
This was needed to support gcc-4.{6..7} on GNU/Linux Ubuntu 14
So I defined _GLIBCXX_USE_NANOSLEEP if not enabled at configure time,
To avoid messing up configurations it is only set for 4.7 and earlier,
but can extended to other versions if needed (4.8 seems OK).
Also config file is inserted before any header when it was needed.
Observed issue on Ubuntu 14.04.5 x86_64 with g++-4.7 package
(g++ (Ubuntu/Linaro 4.7.3-12ubuntu1) 4.7.3) is:
resource/src/InProcClientWrapper.cpp: \
In member function 'void OC::InProcClientWrapper::listeningFunc()': \
resource/src/InProcClientWrapper.cpp:107:13: \
error: 'sleep_for' is not a member of 'std::this_thread'
Bug: https://jira.iotivity.org/browse/IOT-2158
Change-Id: Ib63aa289e91cc5926946786ae2ce03525d83a37c
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19831
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>