How to combine C and XC?

If you have a simple question and just want an answer.
Bayanaa
Active Member
Posts: 33
Joined: Fri Feb 07, 2014 3:03 pm

How to combine C and XC?

Post by Bayanaa »

I am applying some dsp on dj kit with c programming.

My c function is fft and input is complex number. but xc return int value

in my function header

cfunction.h
#ifndef CFUNCTION_H_
#define CFUNCTION_H_
#ifdef __XC__
#define EXTERNAL extern
#else
#define EXTERNAL extern "C"
#endif
#include <xccompat.h>
#include <complex.h>
typedef complex cplx
EXTERNAL int cfunction(int samples[]);
//EXTERNAL void fft(cplx x[], int n);
#endif /* CFUNCTION_H_ */

 
compiler says : error: parse error before "cplx"
 
how to correctly use c codes in xc?
also fft includes pointer. But xc does not support pointers as I know.
 
even I do the following:
 
#include <xccompat.h>
#include <complex.h>
EXTERNAL void fft(complex x[], int n);
compiler say:error: parse error before "_Complex"
_Complex is inside the complex.h of xc
 

any suggession?


User avatar
davelacey
Experienced Member
Posts: 104
Joined: Fri Dec 11, 2009 8:29 pm

Post by davelacey »

xC does not support c99 complex numbers (as of xTIMEcomposer 13.1.0).