Am Mon, 27 May 2013 13:00:10 +0200
schrieb Stéphane Letz <l...@grame.fr>:

> Too fast…. The code is not finished…
> 
> Hold on…

Right, I see you added the implementation, too :) .

So far I had to add a few patches (see attachments). They address the following
three issues:

- readCDSPFactoryFromBitcodeFile() had an argument of type std::string
- the declarations of instanceInitCDSPInstance() and initCDSPInstance() were
  missing their second argument
- the files compiler/generator/llvm_dsp_aux.{cpp,hh} were missing an 'extern
  "C"' around  the C API, leading to link time errors (actually, I'm not sure
  if 'extern "C"' regions can be nested; if not, you'll have to modify the
  patch slightly)

So far faust compiles and a simple python test script works.  You'll here from
me if I find anything else :) .

-- 
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup
--- compiler/generator/llvm_dsp_aux.cpp~	2013-05-27 16:23:19.261033972 +0200
+++ compiler/generator/llvm_dsp_aux.cpp	2013-05-27 16:24:11.045077117 +0200
@@ -603,8 +603,12 @@
 }
 
 // Public C interface
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 EXPORT llvm_dsp_factory* createCDSPFactory(int argc, const char *argv[], 
                         const char* library_path, const char* draw_path, const char* name, 
                         const char* input, const char* target, 
                         char* error_msg, int opt_level)
@@ -699,5 +703,9 @@
 
 EXPORT void deleteCDSPInstance(llvm_dsp* dsp)
 {
     delete dsp; 
-}
\ Kein Zeilenumbruch am Dateiende.
+}
+
+#ifdef __cplusplus
+}
+#endif
--- compiler/generator/llvm_dsp_aux.hh~	2013-05-27 16:25:55.742975398 +0200
+++ compiler/generator/llvm_dsp_aux.hh	2013-05-27 16:32:05.586507770 +0200
@@ -251,8 +251,13 @@
 EXPORT void deleteDSPInstance(llvm_dsp* dsp);
 
 // Public C interface
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 EXPORT llvm_dsp_factory* createCDSPFactory(int argc, const char *argv[], 
                         const char* library_path, const char* draw_path, const char* name, 
                         const char* input, const char* target, 
                         char* error_msg, int opt_level);
@@ -292,8 +297,12 @@
 EXPORT llvm_dsp* createCDSPInstance(llvm_dsp_factory* factory);
 
 EXPORT void deleteCDSPInstance(llvm_dsp* dsp);
 
+#ifdef __cplusplus
+}
+#endif
+
 #ifdef WIN32
 
 #ifdef __cplusplus
 }
--- compiler/generator/llvm_dsp_aux.hh~	2013-05-27 17:25:58.066187882 +0200
+++ compiler/generator/llvm_dsp_aux.hh	2013-05-27 17:27:12.629916500 +0200
@@ -285,11 +285,11 @@
 EXPORT int getNumInputsCDSPInstance(llvm_dsp* dsp);
 
 EXPORT int getNumOutputsCDSPInstance(llvm_dsp* dsp);
 
-EXPORT void instanceInitCDSPInstance(llvm_dsp* dsp);
+EXPORT void instanceInitCDSPInstance(llvm_dsp* dsp, int samplingFreq);
 
-EXPORT void initCDSPInstance(llvm_dsp* dsp);
+EXPORT void initCDSPInstance(llvm_dsp* dsp, int samplingFreq);
 
 EXPORT void buildUserInterfaceCDSPInstance(llvm_dsp* dsp, UIGlue* interface);
 
 EXPORT void computeCDSPInstance(llvm_dsp* dsp, int count, FAUSTFLOAT** input, FAUSTFLOAT** output);
--- compiler/generator/llvm-c-dsp.h~	2013-05-27 15:13:24.767672950 +0200
+++ compiler/generator/llvm-c-dsp.h	2013-05-27 15:14:30.248736087 +0200
@@ -94,9 +94,9 @@
  * @param bit_code_path - the LLVM bitcode file pathname
  * @param target - the LLVM machine target (using empty string will takes current machine settings)
  * @param opt_level - LLVM IR to IR optimization level (from 0 to 3)
 */
-llvm_dsp_factory* readCDSPFactoryFromBitcodeFile(const char* bit_code_path, const std::string& target, int opt_level);
+llvm_dsp_factory* readCDSPFactoryFromBitcodeFile(const char* bit_code_path, const char* target, int opt_level);
 
 /**
  * Write a Faust DSP factory into a LLVM bitcode file.
  * 
--- compiler/generator/llvm_dsp_aux.cpp~	2013-05-27 15:08:03.449131661 +0200
+++ compiler/generator/llvm_dsp_aux.cpp	2013-05-27 15:14:23.586730165 +0200
@@ -626,9 +626,9 @@
 {
     return writeDSPFactoryToBitcode(factory).c_str();
 }
 
-EXPORT llvm_dsp_factory* readCDSPFactoryFromBitcodeFile(const char* bit_code_path, const std::string& target, int opt_level)
+EXPORT llvm_dsp_factory* readCDSPFactoryFromBitcodeFile(const char* bit_code_path, const char* target, int opt_level)
 {
     return readDSPFactoryFromBitcodeFile(bit_code_path, target, opt_level);
 }
 
--- compiler/generator/llvm_dsp_aux.hh~	2013-05-27 16:32:50.899779510 +0200
+++ compiler/generator/llvm_dsp_aux.hh	2013-05-27 16:37:59.318448283 +0200
@@ -267,9 +267,9 @@
 EXPORT llvm_dsp_factory* readCDSPFactoryFromBitcode(const char* bit_code, const char* target, int opt_level);
 
 EXPORT const char* writeCDSPFactoryToBitcode(llvm_dsp_factory* factory);
 
-EXPORT llvm_dsp_factory* readCDSPFactoryFromBitcodeFile(const char* bit_code_path, const std::string& target, int opt_level);
+EXPORT llvm_dsp_factory* readCDSPFactoryFromBitcodeFile(const char* bit_code_path, const char* target, int opt_level);
 
 EXPORT void writeCDSPFactoryToBitcodeFile(llvm_dsp_factory* factory, const char* bit_code_path);
 
 EXPORT llvm_dsp_factory* readCDSPFactoryFromIR(const char* ir_code, const char* target, int opt_level);

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to