Date: Wednesday, January 18, 2006 @ 18:02:25
Author: marc
Path: /cvsroot/carob/carob
Modified: include/JavaSocket.hpp (1.21 -> 1.22) src/JavaSocket.cpp (1.34
-> 1.35)
Added: "#error __BYTE_ORDER undefined". Re-ordered #includes top-bottom.
------------------------+
include/JavaSocket.hpp | 8 +++++---
src/JavaSocket.cpp | 13 +++++++++----
2 files changed, 14 insertions(+), 7 deletions(-)
Index: carob/include/JavaSocket.hpp
diff -u carob/include/JavaSocket.hpp:1.21 carob/include/JavaSocket.hpp:1.22
--- carob/include/JavaSocket.hpp:1.21 Wed Jan 18 14:50:27 2006
+++ carob/include/JavaSocket.hpp Wed Jan 18 18:02:25 2006
@@ -22,11 +22,13 @@
#ifndef SOCKET_H_
#define SOCKET_H_
-#include <netinet/in.h> //for in_addr_t
+#include "StringCodecs.hpp"
+#include "CarobException.hpp"
+
#include <string>
-#include "CarobException.hpp"
-#include "StringCodecs.hpp"
+#include <netinet/in.h> //for in_addr_t
+
namespace CarobNS {
Index: carob/src/JavaSocket.cpp
diff -u carob/src/JavaSocket.cpp:1.34 carob/src/JavaSocket.cpp:1.35
--- carob/src/JavaSocket.cpp:1.34 Wed Jan 18 14:50:27 2006
+++ carob/src/JavaSocket.cpp Wed Jan 18 18:02:25 2006
@@ -19,14 +19,15 @@
* Contributor(s): Zsolt Simon
*/
-#include <errno.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
+#include "JavaSocket.hpp"
#include "Common.hpp"
-#include "JavaSocket.hpp"
#include "SystemDependantDefs.hpp"
+#include <netdb.h> // getaddrinfo() etc.
+#include <netinet/tcp.h> // TCP_NODELAY etc.
+#include <errno.h>
+
using std::wstring;
using namespace CarobNS;
@@ -364,6 +365,10 @@
const uint64_t JavaSocket::ntohll(const uint64_t &n) const
{
+#ifndef __BYTE_ORDER // typically found through <sys/param.h>
+ // or <netinet/*.h>
+#error __BYTE_ORDER undefined: unknown endianness, can't implement 64bits swaps
+#endif
#if __BYTE_ORDER == __BIG_ENDIAN
return n;
#else
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits