eccodes/fortran/grib_fortran_kinds.c

44 lines
1.1 KiB
C
Raw Permalink Normal View History

2013-03-25 12:04:10 +00:00
/*
2020-01-28 14:32:34 +00:00
* (C) Copyright 2005- ECMWF.
2013-03-25 12:04:10 +00:00
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
2023-12-31 00:14:23 +00:00
void f_sizeof_(void *x, void *y, int *size) {
2013-03-25 12:04:10 +00:00
*size=((char*)y)-((char*)x);
}
2023-12-30 20:53:23 +00:00
2023-12-31 00:14:23 +00:00
void check_double_(double *x, double* y, char* ret) {
2013-03-25 12:04:10 +00:00
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
2023-12-30 20:53:23 +00:00
2023-12-31 00:14:23 +00:00
void check_float_(float* x, float* y, char* ret) {
2013-03-25 12:04:10 +00:00
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
2023-12-31 00:14:23 +00:00
void check_int_(int* x, int* y, char* ret) {
2013-03-25 12:04:10 +00:00
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
2023-12-30 20:53:23 +00:00
2023-12-31 00:14:23 +00:00
void check_long_(long* x, long * y, char* ret) {
2013-03-25 12:04:10 +00:00
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
2023-12-31 00:14:23 +00:00
void check_size_t_(size_t* x, size_t* y, char* ret) {
2013-03-25 12:04:10 +00:00
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
#ifdef __cplusplus
}
#endif