Quellcode durchsuchen

COMP: enable ANSI C, this should make it work with the HP-UX compiler

Alex
Alexander Neundorf vor 18 Jahren
Ursprung
Commit
5615d47198
2 geänderte Dateien mit 12 neuen und 5 gelöschten Zeilen
  1. 7 0
      Tests/SourceGroups/CMakeLists.txt
  2. 5 5
      Tests/SourceGroups/main.c

+ 7 - 0
Tests/SourceGroups/CMakeLists.txt

@@ -1,5 +1,12 @@
 project(SourceGroups)
 
+# We need ansi C support, otherwise it doesn't build e.g. on HP-UX:
+# main.c", line 3: error 1705: Function prototypes are an ANSI feature.
+IF(CMAKE_ANSI_CFLAGS)
+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
+ENDIF(CMAKE_ANSI_CFLAGS)
+
+
 # this is not really a test which can fail
 # it is more an example with several source_group() 
 # commands.

+ 5 - 5
Tests/SourceGroups/main.c

@@ -1,10 +1,10 @@
 #include <stdio.h>
 
-int foo();
-int bar();
-int foobar();
-int barbar();
-int baz();
+extern int foo(void);
+extern int bar(void);
+extern int foobar(void);
+extern int barbar(void);
+extern int baz(void);
 
 int main()
 {