ysulsky avatar ysulsky committed 11ab67e

make Backtrace.get into a (unit -> string) Or_error.t and always compile it

Comments (0)

Files changed (4)

base/core/lib/backtrace.ml

-external get : unit -> string = "backtrace_get"
+open Std_internal
+
+INCLUDE "config.mlh"
+IFDEF ARCH_x86_64 THEN
+external backtrace_get : unit -> string = "backtrace_get"
+let get = Ok backtrace_get
+ELSE
+let get = Or_error.error "unimplemented" "Backtrace.get" <:sexp_of< string >>
+ENDIF

base/core/lib/backtrace.mli

 (* Dumping of OCaml stack backtraces at runtime. *)
 
-val get : unit -> string
+val get : (unit -> string) Or_error.t

base/core/lib/discover.sh

   $(if [[ ${WORD_SIZE} = 64 ]]; then
        echo 'printf ("DEFINE ARCH_SIXTYFOUR\n");';
     fi)
+  $(if [[ $(uname -p) = "x86_64" ]]; then 
+       echo 'printf ("DEFINE ARCH_x86_64\n");';
+    fi)
+  $(if [[ $(uname -p) = "i386" ]]; then 
+       echo 'printf ("DEFINE ARCH_i386\n");';
+    fi)
   $(cpp_test MSG_NOSIGNAL "defined MSG_NOSIGNAL" \
      "Bigstring.(unsafe_|really_)?send(to)?(_noblocking)?_no_sigpipe\
  will not be availlable")
 "$PGM" > "$OUT"
 rm "$PGM"
 mv "$OUT" "$ML_OUTFILE"
-sed -e 's|^DEFINE *|#define JSC_|' "$ML_OUTFILE" > "$C_OUTFILE"
+cat "$ML_OUTFILE" \
+    | sed -e 's|^DEFINE *|#define JSC_|' \
+    | sed -e 's|\(#define JSC_[^ ]*\) *=|\1 |' > "$C_OUTFILE"

base/core/oasis.sh

         case "$mod" in
             Linux_ext|Bigstring_marshal)
                 if [[ "$enable_linux" == "true" ]]; then echo "$mod"; fi;;
-	    Backtrace)
-		if [[ "$(uname -m)" == "x86_64" ]]; then echo "$mod"; fi;;
             *) echo "$mod";;
         esac
     done
             linux_ext_stubs|bigstring_marshal_stubs)
                 if [[ "$enable_linux" == "true" ]]; then echo "$stub"; fi;;
 	    backtrace_stubs)
-		if [[ "$(uname -m)" == "x86_64" ]]; then echo "$stub"; fi;;
+		if [[ "$(uname -p)" == "x86_64" ]]; then echo "$stub"; fi;;
             *) echo "$stub";;
         esac
     done
 $(tag_for_pack Core $HERE/lib/*.ml)
 
 <lib{,_test}/*.ml{,i}>: syntax_camlp4o
-<lib/{std,core_int63,bigstring,core_mutex,core_unix,bigstring_marshal,linux_ext}.ml{,i}>:pkg_camlp4.macro
+<lib/{std,core_int63,bigstring,core_mutex,core_unix,bigstring_marshal,linux_ext,backtrace}.ml{,i}>:pkg_camlp4.macro
 EOF
 
 cd $HERE
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.