https://github.com/Kitware/CMake
Raw File
Tip revision: a00f1beb530c0c9fff8deab150a07b4c3839285b authored by Bill Hoffman on 05 May 2008, 17:38:19 UTC
ENH: merge in changes for generated docs
Tip revision: a00f1be
CheckTypeSizeC.c.in
#cmakedefine CHECK_TYPE_SIZE_TYPE @CHECK_TYPE_SIZE_TYPE@
#ifdef CHECK_TYPE_SIZE_TYPE

@CHECK_TYPE_SIZE_PREINCLUDE@
#ifdef HAVE_SYS_TYPES_H
#  include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */

#ifdef HAVE_STDINT_H
#  include <stdint.h>
#endif /* HAVE_STDINT_H */

#ifdef HAVE_STDDEF_H
#  include <stddef.h>
#endif /* HAVE_STDDEF_H */

@CHECK_TYPE_SIZE_PREMAIN@

#ifdef __CLASSIC_C__
# define const
#endif

#define SIZE (sizeof(@CHECK_TYPE_SIZE_TYPE@))
const char info_sizeof[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','o','f','[',
  ('0' + ((SIZE / 10000)%10)),
  ('0' + ((SIZE / 1000)%10)),
  ('0' + ((SIZE / 100)%10)),
  ('0' + ((SIZE / 10)%10)),
  ('0' +  (SIZE    % 10)), 
  ']','\0'};


#ifdef __CLASSIC_C__
int main(){
  int ac;
  char*av[];
#else
int main(int ac, char*av[]){
#endif
  return (&info_sizeof[0] != &info_sizeof[0]);
}

#else  /* CHECK_TYPE_SIZE_TYPE */

#  error "CHECK_TYPE_SIZE_TYPE has to specify the type"

#endif /* CHECK_TYPE_SIZE_TYPE */
back to top