mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
* gh_data.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
This commit is contained in:
parent
f66f1fdae5
commit
d3d183b5ef
1 changed files with 11 additions and 7 deletions
|
@ -41,6 +41,10 @@
|
||||||
|
|
||||||
/* data initialization and C<->Scheme data conversion */
|
/* data initialization and C<->Scheme data conversion */
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "libguile/gh.h"
|
#include "libguile/gh.h"
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -139,7 +143,7 @@ gh_doubles2scm (const double *d, long n)
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_ARRAYS
|
#ifdef SCM_HAVE_ARRAYS
|
||||||
/* Do not use this function for building normal Scheme vectors, unless
|
/* Do not use this function for building normal Scheme vectors, unless
|
||||||
you arrange for the elements to be protected from GC while you
|
you arrange for the elements to be protected from GC while you
|
||||||
initialize the vector. */
|
initialize the vector. */
|
||||||
|
@ -268,7 +272,7 @@ gh_scm2chars (SCM obj, char *m)
|
||||||
for (i = 0; i < n; ++i)
|
for (i = 0; i < n; ++i)
|
||||||
m[i] = SCM_INUM (SCM_VELTS (obj)[i]);
|
m[i] = SCM_INUM (SCM_VELTS (obj)[i]);
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_ARRAYS
|
#ifdef SCM_HAVE_ARRAYS
|
||||||
case scm_tc7_byvect:
|
case scm_tc7_byvect:
|
||||||
n = SCM_UVECTOR_LENGTH (obj);
|
n = SCM_UVECTOR_LENGTH (obj);
|
||||||
if (m == 0)
|
if (m == 0)
|
||||||
|
@ -327,7 +331,7 @@ gh_scm2shorts (SCM obj, short *m)
|
||||||
for (i = 0; i < n; ++i)
|
for (i = 0; i < n; ++i)
|
||||||
m[i] = SCM_INUM (SCM_VELTS (obj)[i]);
|
m[i] = SCM_INUM (SCM_VELTS (obj)[i]);
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_ARRAYS
|
#ifdef SCM_HAVE_ARRAYS
|
||||||
case scm_tc7_svect:
|
case scm_tc7_svect:
|
||||||
n = SCM_UVECTOR_LENGTH (obj);
|
n = SCM_UVECTOR_LENGTH (obj);
|
||||||
if (m == 0)
|
if (m == 0)
|
||||||
|
@ -376,7 +380,7 @@ gh_scm2longs (SCM obj, long *m)
|
||||||
: scm_num2long (val, 0, NULL);
|
: scm_num2long (val, 0, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_ARRAYS
|
#ifdef SCM_HAVE_ARRAYS
|
||||||
case scm_tc7_ivect:
|
case scm_tc7_ivect:
|
||||||
case scm_tc7_uvect:
|
case scm_tc7_uvect:
|
||||||
n = SCM_UVECTOR_LENGTH (obj);
|
n = SCM_UVECTOR_LENGTH (obj);
|
||||||
|
@ -430,7 +434,7 @@ gh_scm2floats (SCM obj, float *m)
|
||||||
m[i] = SCM_REAL_VALUE (val);
|
m[i] = SCM_REAL_VALUE (val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_ARRAYS
|
#ifdef SCM_HAVE_ARRAYS
|
||||||
case scm_tc7_fvect:
|
case scm_tc7_fvect:
|
||||||
n = SCM_UVECTOR_LENGTH (obj);
|
n = SCM_UVECTOR_LENGTH (obj);
|
||||||
if (m == 0)
|
if (m == 0)
|
||||||
|
@ -493,7 +497,7 @@ gh_scm2doubles (SCM obj, double *m)
|
||||||
m[i] = SCM_REAL_VALUE (val);
|
m[i] = SCM_REAL_VALUE (val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_ARRAYS
|
#ifdef SCM_HAVE_ARRAYS
|
||||||
case scm_tc7_fvect:
|
case scm_tc7_fvect:
|
||||||
n = SCM_UVECTOR_LENGTH (obj);
|
n = SCM_UVECTOR_LENGTH (obj);
|
||||||
if (m == 0)
|
if (m == 0)
|
||||||
|
@ -648,7 +652,7 @@ gh_vector_length (SCM v)
|
||||||
return (unsigned long) SCM_VECTOR_LENGTH (v);
|
return (unsigned long) SCM_VECTOR_LENGTH (v);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_ARRAYS
|
#ifdef SCM_HAVE_ARRAYS
|
||||||
/* uniform vector support */
|
/* uniform vector support */
|
||||||
|
|
||||||
/* returns the length as a C unsigned long integer */
|
/* returns the length as a C unsigned long integer */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue