Commit ae0d9040 authored by gabrieldemarmiesse's avatar gabrieldemarmiesse

To fix the tests, a "cdef extern from" was used.

parent c1e60669
#include "C_func_file.h"
void multiply_by_10_in_C(double arr[], unsigned int n) void multiply_by_10_in_C(double arr[], unsigned int n)
{ {
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
......
#ifndef C_FUNC_FILE_H
#define C_FUNC_FILE_H
void multiply_by_10_in_C(double arr[], unsigned int n); void multiply_by_10_in_C(double arr[], unsigned int n);
#endif
# distutils: sources = C_func_file.c cdef extern from "C_func_file.c":
# distutils: include_dirs = ./ # C is include here so that it doesn't need to be compiled externally
pass
cdef extern from "C_func_file.h": cdef extern from "C_func_file.h":
void multiply_by_10_in_C(double *, unsigned int) void multiply_by_10_in_C(double *, unsigned int)
......
...@@ -706,9 +706,10 @@ array with an external C function implemented in :file:`C_func_file.c`: ...@@ -706,9 +706,10 @@ array with an external C function implemented in :file:`C_func_file.c`:
.. literalinclude:: ../../examples/memoryviews/C_func_file.c .. literalinclude:: ../../examples/memoryviews/C_func_file.c
:linenos: :linenos:
This file comes with a header file called :file:`C_func_file.h` containing:: This file comes with a header file called :file:`C_func_file.h` containing:
void multiply_by_10_in_C(double arr[], unsigned int n); .. literalinclude:: ../../examples/memoryviews/C_func_file.h
:linenos:
where ``arr`` points to the array and ``n`` is its size. where ``arr`` points to the array and ``n`` is its size.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment