unwind: improve compilation on Linux with gcc

gcc still defaults to C89 which does not support BCPL style comments.  This
splits up the sources list in CMakeLists and selectively adds compile flags for
using C99 which avoids a number of warnings in -Wpedantic mode.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@228665 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/src/Unwind/CMakeLists.txt b/src/Unwind/CMakeLists.txt
index 56c217d..77bb019 100644
--- a/src/Unwind/CMakeLists.txt
+++ b/src/Unwind/CMakeLists.txt
@@ -1,20 +1,24 @@
 # Get sources
-set(LIBUNWIND_SOURCES
-  libunwind.cpp
-  Unwind-EHABI.cpp
-  UnwindLevel1.c
-  UnwindLevel1-gcc-ext.c
-  Unwind-sjlj.c
-)
 
-append_if(LIBUNWIND_SOURCES APPLE Unwind_AppleExtras.cpp)
+set(LIBUNWIND_CXX_SOURCES
+    libunwind.cpp
+    Unwind-EHABI.cpp)
+append_if(LIBUNWIND_CXX_SOURCES APPLE Unwind_AppleExtras.cpp)
+
+set(LIBUNWIND_C_SOURCES
+    UnwindLevel1.c
+    UnwindLevel1-gcc-ext.c
+    Unwind-sjlj.c)
+set_source_files_properties(${LIBUNWIND_C_SOURCES}
+                            PROPERTIES
+                              COMPILE_FLAGS "-std=c99")
 
 set(LIBUNWIND_ASM_SOURCES
-  UnwindRegistersRestore.S
-  UnwindRegistersSave.S
-)
-
-set_source_files_properties(${LIBUNWIND_ASM_SOURCES} PROPERTIES LANGUAGE C)
+    UnwindRegistersRestore.S
+    UnwindRegistersSave.S)
+set_source_files_properties(${LIBUNWIND_ASM_SOURCES}
+                            PROPERTIES
+                              LANGUAGE C)
 
 set(LIBUNWIND_HEADERS
   AddressSpace.hpp
@@ -40,18 +44,15 @@
   source_group("Header Files" FILES ${LIBUNWIND_HEADERS})
 endif()
 
+set(LIBUNWIND_SOURCES
+    ${LIBUNWIND_CXX_SOURCES}
+    ${LIBUNWIND_C_SOURCES}
+    ${LIBUNWIND_ASM_SOURCES})
+
 if (LIBUNWIND_ENABLE_SHARED)
-  add_library(unwind SHARED
-    ${LIBUNWIND_SOURCES}
-    ${LIBUNWIND_ASM_SOURCES}
-    ${LIBUNWIND_HEADERS}
-    )
+  add_library(unwind SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
 else()
-  add_library(unwind STATIC
-    ${LIBUNWIND_SOURCES}
-    ${LIBUNWIND_ASM_SOURCES}
-    ${LIBUNWIND_HEADERS}
-    )
+  add_library(unwind STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
 endif()
 
 include_directories("${LIBCXXABI_LIBCXX_INCLUDES}")