| 1 |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
| 2 |
* Copyright by The HDF Group. * |
| 3 |
* All rights reserved. * |
| 4 |
* * |
| 5 |
* This file is part of HDF5. The full HDF5 copyright notice, including * |
| 6 |
* terms governing use, modification, and redistribution, is contained in * |
| 7 |
* the COPYING file, which can be found at the root of the source code * |
| 8 |
* distribution tree, or in https://www.hdfgroup.org/licenses. * |
| 9 |
* If you do not have access to either file, you may request a copy from * |
| 10 |
* [email protected]. * |
| 11 |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
| 12 |
|
| 13 |
#ifdef CXX_HAVE_OFFSETOF |
| 14 |
|
| 15 |
#include <stdio.h> |
| 16 |
#include <stddef.h> |
| 17 |
|
| 18 |
#ifdef FC_DUMMY_MAIN |
| 19 |
#ifndef FC_DUMMY_MAIN_EQ_F77 |
| 20 |
# ifdef __cplusplus |
| 21 |
extern "C" |
| 22 |
# endif |
| 23 |
int FC_DUMMY_MAIN() |
| 24 |
{ return 1;} |
| 25 |
#endif |
| 26 |
#endif |
| 27 |
int |
| 28 |
main () |
| 29 |
{ |
| 30 |
|
| 31 |
struct index_st |
| 32 |
{ |
| 33 |
unsigned char type; |
| 34 |
unsigned char num; |
| 35 |
unsigned int len; |
| 36 |
}; |
| 37 |
typedef struct index_st index_t; |
| 38 |
int x,y; |
| 39 |
x = offsetof(struct index_st, len); |
| 40 |
y = offsetof(index_t, num) |
| 41 |
|
| 42 |
; |
| 43 |
return 0; |
| 44 |
} |
| 45 |
|
| 46 |
#endif |