Tests code updated for build with MS Visual Studio #49

Closed
wants to merge 6 commits into
from

Conversation

Projects
None yet
3 participants
Member

snikulov commented Nov 9, 2012

Fixes for missed API on windows for tests

  • gettimeofday
  • strcasecmp
  • snprintf

Here the error without the fix:

Linking C executable ..\lib1501.exe
lib1501.c.obj : error LNK2019: unresolved external symbol _gettimeofday referenc
ed in function _test
..\lib1501.exe : fatal error LNK1120: 1 unresolved externals
LINK Pass 1 failed. with 2
NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe"' :
return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

C:\WORK\oss\b.curl>

Member

snikulov commented Nov 9, 2012

Only 897aa85 change is matter.

Owner

bagder commented Nov 10, 2012

Thanks for this. I will merge this tomorrow.

Collaborator

pierrejoye commented Nov 11, 2012

I would prefer to provide an implementation when not available and keep the names of well known functions.

ie: I did that in php http://lxr.php.net/xref/PHP_5_4/win32/time.c#59

Member

snikulov commented Nov 11, 2012

@pierrejoye This was also initially comes to mine mind.

Here is what I considered
http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/port/gettimeofday.c;h=75a91993b74414c0a1c13a2a09ce739cb8aa8a08;hb=HEAD
and
http://www.suacommunity.com/dictionary/gettimeofday-entry.php

But then I look around and find already implemented curl api to substitute.
This is holds me from copy-paste idea.

Owner

bagder commented Nov 11, 2012

Right, as we already have these functions in place so this patch makes sense. Pierre's change is indeed interesting as well but should probably be made separately and is a slightly bigger take.

Owner

bagder commented Nov 13, 2012

Thanks, I've merged and pushed that commit now. Hash 7c0cbcf in the git repo.

bagder closed this Nov 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment