emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/org 9e8215f: ob-C.el: Fix missing C, C++ declar


From: ELPA Syncer
Subject: [elpa] externals-release/org 9e8215f: ob-C.el: Fix missing C, C++ declaration
Date: Sat, 16 Jan 2021 15:57:10 -0500 (EST)

branch: externals-release/org
commit 9e8215f4a5df7d03ac787da78d28f69a4c18e7d3
Author: tbanelwebmin@free.fr <tbanelwebmin@free.fr>
Commit: tbanel <tbanelwebmin@free.fr>

    ob-C.el: Fix missing C, C++ declaration
    
    * lisp/ob-C.el (org-babel-C-utility-header-to-C): Add declaration of
      strcmp() for C and C++.
    
    * testing/examples/ob-C-test.org (Simple tests): Remove a spurious \n
      new line.
---
 lisp/ob-C.el                   | 10 ++++++++--
 testing/examples/ob-C-test.org |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 6e33901..1dde289 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -4,6 +4,7 @@
 
 ;; Author: Eric Schulte
 ;;      Thierry Banel
+;; Maintainer: Thierry Banel
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: https://orgmode.org
 
@@ -425,7 +426,12 @@ of the same value."
 into a column number."
   (pcase org-babel-c-variant
     ((or `c `cpp)
-     "int get_column_num (int nbcols, const char** header, const char* column)
+     (concat
+      (if (eq org-babel-c-variant 'c)
+          "extern "
+       "extern \"C\" ")
+      "int strcmp (const char *, const char *);
+int get_column_num (int nbcols, const char** header, const char* column)
 {
   int c;
   for (c=0; c<nbcols; c++)
@@ -433,7 +439,7 @@ into a column number."
       return c;
   return -1;
 }
-")
+"))
     (`d
      "int get_column_num (string[] header, string column)
 {
diff --git a/testing/examples/ob-C-test.org b/testing/examples/ob-C-test.org
index 347607c..3b0a41b 100644
--- a/testing/examples/ob-C-test.org
+++ b/testing/examples/ob-C-test.org
@@ -159,6 +159,6 @@ void main()
       writef ("%s ", tinomogen[i][j]);
     writeln();
   }
-  writefln ("Friday %s\n", tinomogen_h(4,"day"));
+  writefln ("Friday %s", tinomogen_h(4,"day"));
 }
 #+end_src



reply via email to

[Prev in Thread] Current Thread [Next in Thread]