build: Explicitly define _GLIBCXX_USE_NANOSLEEP if gcc < 4.8 is used

Change-Id: I2f216ba8c602d1a81433a566318a49f17728a8dd
Refs: #2499
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 95d0d8a..759fcc8 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -124,6 +124,8 @@
             flags['CXXFLAGS'] += ['-std=c++0x']
         else:
             flags['CXXFLAGS'] += ['-std=c++11']
+        if version < (4, 8, 0):
+            flags['DEFINES'] += ['_GLIBCXX_USE_NANOSLEEP'] # Bug #2499
         return flags
 
     def getDebugFlags(self, conf):