Browse Source

[master] urgent care fix for build errors with sunstudio:
- use <xxx.h> instead of <cxxx> (e.g. use stdlib.h instead of cstdlib)
- avoid using variable length array
as for the first point, it didn't make sense that cxxx didn't work and we may
want to look into it further to understand the real cause. but since this has
been breaking build, and it somehow fixes the issue, I'll apply it for now.

okayed on jabber.

JINMEI Tatuya 14 years ago
parent
commit
a2d07257bc

+ 1 - 1
src/bin/auth/common.cc

@@ -14,7 +14,7 @@
 
 #include <auth/common.h>
 #include <auth/spec_config.h>
-#include <cstdlib>
+#include <stdlib.h>
 
 using std::string;
 

+ 1 - 1
src/bin/sockcreator/sockcreator.cc

@@ -18,7 +18,7 @@
 
 #include <unistd.h>
 #include <cerrno>
-#include <cstring>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>

+ 1 - 1
src/bin/sockcreator/tests/sockcreator_tests.cc

@@ -256,7 +256,7 @@ TEST(run, bad_sockets) {
     // We need to construct the answer, but it depends on int length.
     size_t int_len(sizeof(int));
     size_t result_len(4 + 2 * int_len);
-    char result[result_len];
+    char result[4 + sizeof(int) * 2];
     // Both errno parts should be 0
     memset(result, 0, result_len);
     // Fill the 2 control parts

+ 1 - 1
src/lib/dns/buffer.h

@@ -15,7 +15,7 @@
 #ifndef __BUFFER_H
 #define __BUFFER_H 1
 
-#include <cstdlib>
+#include <stdlib.h>
 #include <cstring>
 #include <vector>
 

+ 3 - 3
src/lib/util/unittests/fork.cc

@@ -20,10 +20,10 @@
 #include <sys/wait.h>
 #include <unistd.h>
 #include <signal.h>
-#include <cstring>
+#include <string.h>
 #include <cerrno>
-#include <cstdlib>
-#include <cstdio>
+#include <stdlib.h>
+#include <stdio.h>
 
 using namespace isc::util::io;