Hello all
im porting c code to windows 32 bit using visual studio express
now i have 3 functions that i can't find any alternatives in windows
they are:
alarm
bzero
bcopy
what are the equivalent methods in C win32 ?
views:
149answers:
3
+4
A:
alarm you are going to need to dig for the other two are:
#define bzero(b,len) (memset((b), '\0', (len)), (void) 0)
#define bcopy(b1,b2,len) (memmove((b2), (b1), (len)), (void) 0)
Romain Hippeau
2010-08-16 11:28:55
The comma operator seems unnecessary, you could just cast the result of the functions to `void`.
caf
2010-08-16 11:56:16
well now i see i need replacement for alarm function also...
2010-08-16 12:18:18
+2
A:
From which platform are you porting to windows? Anyhow bzero
and bcopy
are depreciated since quite a while.
for bzero:
This function is deprecated (marked as LEGACY in POSIX.1-2001): use memset(3) in new programs. POSIX.1-2008 removes the specifica- tion of bzero().
for bcopy:
This function is deprecated (marked as LEGACY in POSIX.1-2001): use memcpy(3) or memmove(3) in new programs. Note that the first two arguments are interchanged for memcpy(3) and memmove(3). POSIX.1-2008 removes the specification of bcopy().
So just fix your code and use the proposed replacements.
Jens Gustedt
2010-08-16 16:37:16