bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

glob.c and MSVC


From: Gisle Vanem
Subject: glob.c and MSVC
Date: Wed, 21 Jan 2015 21:34:01 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32

In lib/glob.c, the code:
 #  undef opendir
 #  undef closedir

causes this link error:
  glob.obj : error LNK2019: unresolved external symbol _closedir referenced in 
function _glob_in_dir
  glob.obj : error LNK2019: unresolved external symbol _opendir referenced in 
function _glob_in_dir

I fixed it by instead (line 191):
  # ifndef _MSC_VER
  #  undef opendir
  #  undef closedir
  # endif

No problem for MingW since it has closedir() etc.

But maybe this should be:
  # ifdef HAVE_OPENDIR
  #  undef opendir
  # endif
  # ifdef HAVE_CLOSEDIR
  #  undef closedir
  # endif

This brings up my confusion I have with stuff like
what value REPLACE_CLOSEDIR etc. should have. (IMHO
the value of REPLACE_CLOSEDIR shouldn't be important
unless HAVE_CLOSEDIR is defined). Is it possible to
make only 'rpl_closedir' visible to programs?

I.e. have 'REPLACE_CLOSEDIR = '1 for both MingW and MSVC?
Or are we supposed to generate two sets of all the headers;
1 for MingW and 1 for MSVC. Is so, that's too bad.

Thanks.

--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]