From c701a90695a7f31c1a3aafff3d104df4849b24e1 Mon Sep 17 00:00:00 2001
From: Tommy Olofsson <tommy.olofsson.90@gmail.com>
Date: Tue, 1 Apr 2014 10:37:43 +0200
Subject: [PATCH] More changes for vx.

---
 compiler/C_CodeGen.jrag        |  2 +-
 lib/c/labcomm_compat_vxworks.h |  8 ++++++++
 lib/c/labcomm_decoder.c        | 12 ++++++------
 lib/c/labcomm_error.c          |  2 +-
 4 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/compiler/C_CodeGen.jrag b/compiler/C_CodeGen.jrag
index 008bf70..d148950 100644
--- a/compiler/C_CodeGen.jrag
+++ b/compiler/C_CodeGen.jrag
@@ -161,7 +161,7 @@ aspect C_CodeGen {
     env.println("");
 
     // Include
-    env.println("#include <stdint.h>");
+    // env.println("#include <stdint.h>");
     env.println("#include \"labcomm.h\"");
     for (int i = 0 ; i < includes.size() ; i++) {
       env.println("#include \"" + includes.get(i) + "\"");
diff --git a/lib/c/labcomm_compat_vxworks.h b/lib/c/labcomm_compat_vxworks.h
index 00a2b5a..c5c1572 100644
--- a/lib/c/labcomm_compat_vxworks.h
+++ b/lib/c/labcomm_compat_vxworks.h
@@ -6,8 +6,16 @@
 #endif
 
 #include <types/vxTypes.h>
+#include <selectLib.h>
+#include <types.h>
+#include <timers.h>
 #include <stdio.h>
 
+#ifdef __INT64_MAX__
+#undef INT64_MAX
+#define INT64_MAX __INT64_MAX__
+#endif
+
 #if (CPU == PPC603)
   #undef _LITTLE_ENDIAN
 #endif
diff --git a/lib/c/labcomm_decoder.c b/lib/c/labcomm_decoder.c
index 0606e6f..559cb21 100644
--- a/lib/c/labcomm_decoder.c
+++ b/lib/c/labcomm_decoder.c
@@ -199,9 +199,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
 		     LABCOMM_IOCTL_WRITER_GET_BYTES_WRITTEN,
 		     &signature.size);
   if (err < 0) {
-    /* fprintf(stderr, "Failed to get size: %s\n", strerror(-err)); */
-    labcomm_error_warning(d->error, LABCOMM_ERROR_BAD_WRITER,
-			  "Failed to get size: %s\n", strerror(-err));
+	printf("Failed to get size: %s\n", strerror(-err));
+    /* labcomm_error_fatal_global(LABCOMM_ERROR_BAD_WRITER, */
+    /* 			  "Failed to get size: %s\n", strerror(-err)); */
     result = -ENOENT;
     goto free_signature_name;
   }
@@ -209,9 +209,9 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
 		     LABCOMM_IOCTL_WRITER_GET_BYTE_POINTER,
 		     &signature.signature);
   if (err < 0) {
-    /* fprintf(stderr, "Failed to get pointer: %s\n", strerror(-err)); */
-    labcomm_error_warning(d->error, LABCOMM_ERROR_BAD_WRITER,
-			  "Failed to get pointer: %s\n", strerror(-err));
+    printf("Failed to get pointer: %s\n", strerror(-err));
+    /* labcomm_error_fatal_global(LABCOMM_ERROR_BAD_WRITER, */
+    /* 			  "Failed to get pointer: %s\n", strerror(-err)); */
     result = -ENOENT;
     goto free_signature_name;
   }
diff --git a/lib/c/labcomm_error.c b/lib/c/labcomm_error.c
index 278c5f3..9cae3e7 100644
--- a/lib/c/labcomm_error.c
+++ b/lib/c/labcomm_error.c
@@ -27,6 +27,6 @@ void labcomm_error_fatal_global(enum labcomm_error error,
 				char *format,
 				...)
 {
-  fprintf(stderr, "Fatal error %d\n", error);
+  printf("Fatal error %d\n", error);
   exit(1);
 }
-- 
GitLab