4 * Some helper functions to make libsmi compile with vc++ for win32.
6 * Copyright (c) 2000 E. Schoenfelder, Gaertner Datensysteme Braunschweig.
7 * Copyright (c) 2000 J. Schoenwaelder, Technical University of Braunschweig.
9 * See the file "COPYING" for information on usage and redistribution
10 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12 * @(#) $Id: win.h 8057 2008-04-15 14:31:18Z schoenw $
23 * The access() function exists in the Win32 API, but there are no
24 * defines for the mode parameter. So we provided them here.
38 * Other function prototypes...
41 #if ! defined(__GNUC__) && defined(__STDC__)
42 int __cdecl fileno(FILE *);
46 * isascii() is a non __STDC__ extension needed when __STDC__ is defined in
52 #define isascii(_c) ( (unsigned)(_c) < 0x80 )
57 * Windows seems to lacks C99 function fabsf(), strtold(). Well, this
58 * is only true for some compilers on Windows - gcc is fine since it
59 * comes with a C99 library.
62 #if ! defined(__GNUC__)
64 #define strtold strtod
68 * Some Windows compilers seem to lack strtof() so we fake it here.
72 #define strtof(f1,f2) ((float)strtod(f1,f2))
75 * Windows compiler writers love to issue warnings for C functions
76 * whose names were changed by C++ standards. Since access is used as
77 * the name of a structure member it has to be treated differently.
80 #define access(f1,f2) _access(f1,f2)
81 #define putenv _putenv
82 #define strdup _strdup
83 #define vsnprintf _vsnprintf
84 #define strcasecmp _stricmp