[64bit] autoconf test for GetConsoleScreenBufferInfo

marco atzeri marco.atzeri@gmail.com
Tue May 14 18:30:00 GMT 2013


the attached test extracted by configure of hdf5 is
failing on 32 bit as expected with

/tmp/cc5L84Vo.o: In function `main':
/cygdrive/e/cygwin64/tmp/conftest.c:140: undefined reference to 
`_GetConsoleScreenBufferInfo'
collect2: ld returned 1 exit status

but it is passing on 64 bit

ls -sh conftest.exe
64K conftest.exe

so I guess there is some weird include pulling w32api
as the definition is only on the w32api

$ grep -rH GetConsoleScreenBufferInfo /usr/include/*
/usr/include/w32api/wincon.h:  WINBASEAPI WINBOOL WINAPI 
GetConsoleScreenBufferInfo(HANDLE 
hConsoleOutput,PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);
/usr/include/w32api/wincon.h:WINBASEAPI WINBOOL WINAPI 
GetConsoleScreenBufferInfoEx(


To test just ". config_test.txt"

Regards
Marco




-------------- next part --------------
gcc -o conftest.exe -std=c99 -pedantic -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2 -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants -O3 -fomit-frame-pointer -finline-functions   -ggdb -O2 -pipe  conftest.c -lpthread -lz -lm  
-------------- next part --------------
/* confdefs.h */
#define PACKAGE_NAME "HDF5"
#define PACKAGE_TARNAME "hdf5"
#define PACKAGE_VERSION "1.8.10"
#define PACKAGE_STRING "HDF5 1.8.10"
#define PACKAGE_BUGREPORT "help@hdfgroup.org"
#define PACKAGE_URL ""
#define PACKAGE "hdf5"
#define VERSION "1.8.10"
#define CXX_HAVE_OFFSETOF 1
#define CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define HAVE_LIBM 1
#define STDC_HEADERS 1
#define TIME_WITH_SYS_TIME 1
#define HAVE_DIFFTIME 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_UNISTD_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDDEF_H 1
#define HAVE_SETJMP_H 1
#define HAVE_FEATURES_H 1
#define HAVE_STDINT_H 1
#define HAVE_IO_H 1
#define HAVE_SYS_TIMEB_H 1
#define HAVE_FSEEKO 1
#define HAVE_FTELLO 1
#define SIZEOF_CHAR 1
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#define SIZEOF_UNSIGNED 4
#define SIZEOF_LONG 4
#define SIZEOF_LONG_LONG 8
#define SIZEOF___INT64 0
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#define SIZEOF_LONG_DOUBLE 12
#include <sys/types.h>
#include <stdint.h>
#define SIZEOF_INT8_T 1
#define SIZEOF_UINT8_T 1
#define SIZEOF_INT_LEAST8_T 1
#define SIZEOF_UINT_LEAST8_T 1
#define SIZEOF_INT_FAST8_T 1
#define SIZEOF_UINT_FAST8_T 1
#define SIZEOF_INT16_T 2
#define SIZEOF_UINT16_T 2
#define SIZEOF_INT_LEAST16_T 2
#define SIZEOF_UINT_LEAST16_T 2
#define SIZEOF_INT_FAST16_T 4
#define SIZEOF_UINT_FAST16_T 4
#define SIZEOF_INT32_T 4
#define SIZEOF_UINT32_T 4
#define SIZEOF_INT_LEAST32_T 4
#define SIZEOF_UINT_LEAST32_T 4
#define SIZEOF_INT_FAST32_T 4
#define SIZEOF_UINT_FAST32_T 4
#define SIZEOF_INT64_T 8
#define SIZEOF_UINT64_T 8
#define SIZEOF_INT_LEAST64_T 8
#define SIZEOF_UINT_LEAST64_T 8
#define SIZEOF_INT_FAST64_T 8
#define SIZEOF_UINT_FAST64_T 8
#define SIZEOF_SIZE_T 4
#define SIZEOF_SSIZE_T 4
#define SIZEOF_PTRDIFF_T 4
#include <sys/types.h> /*for off_t definition*/
#define SIZEOF_OFF_T 8
#define SIZEOF_OFF64_T 0
#define DEV_T_IS_SCALAR 1
#define HAVE_ZLIB_H 1
#define HAVE_LIBZ 1
#define HAVE_FILTER_DEFLATE 1
#define HAVE_PTHREAD_H 1
#define HAVE_LIBPTHREAD 1
#define HAVE_DECL_TZNAME 0
#define HAVE_STRUCT_TIMEZONE 1
#define GETTIMEOFDAY_GIVES_TZ 1
#define HAVE_STAT_ST_BLOCKS 1
/* end confdefs.h.  */
/* Define GetConsoleScreenBufferInfo to an innocuous variant, in case <limits.h> declares GetConsoleScreenBufferInfo.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define GetConsoleScreenBufferInfo innocuous_GetConsoleScreenBufferInfo

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char GetConsoleScreenBufferInfo (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef GetConsoleScreenBufferInfo

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char GetConsoleScreenBufferInfo ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_GetConsoleScreenBufferInfo || defined __stub___GetConsoleScreenBufferInfo
choke me
#endif

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
return GetConsoleScreenBufferInfo ();
  ;
  return 0;
}


More information about the Cygwin-apps mailing list