Tidying up WinCE support.

This commit is contained in:
Andy Polyakov 2005-11-09 17:19:38 +00:00
parent 2c730f6fc2
commit 63d3a9c5ea
2 changed files with 15 additions and 10 deletions

21
e_os.h
View File

@ -249,16 +249,16 @@ extern "C" {
/* /*
* Defining _WIN32_WINNT here in e_os.h implies certain "discipline." * Defining _WIN32_WINNT here in e_os.h implies certain "discipline."
* Most notably we ought to check for availability of each specific * Most notably we ought to check for availability of each specific
* routine with GetProcAddress() and/or quard NT-specific calls with * routine with GetProcAddress() and/or guard NT-specific calls with
* GetVersion() < 0x80000000. One can argue that in latter "or" case * GetVersion() < 0x80000000. One can argue that in latter "or" case
* we ought to /DELAYLOAD some .DLLs in order to protect ourselves * we ought to /DELAYLOAD some .DLLs in order to protect ourselves
* against run-time link errors. This doesn't seem to be necessary, * against run-time link errors. This doesn't seem to be necessary,
* because it turned out that already Windows 95, first non-NT Win32 * because it turned out that already Windows 95, first non-NT Win32
* implementation, is equipped with at least NT 3.51 stubs, dummy * implementation, is equipped with at least NT 3.51 stubs, dummy
* routines with same name, but which do nothing. Meaning that it's * routines with same name, but which do nothing. Meaning that it's
* apparently appropriate to guard generic NT calls with GetVersion * apparently sufficient to guard "vanilla" NT calls with GetVersion
* alone, while NT 4.0 and above calls ought to be additionally * alone, while NT 4.0 and above interfaces ought to be linked with
* checked upon with GetProcAddress. * GetProcAddress at run-time.
*/ */
# define _WIN32_WINNT 0x0400 # define _WIN32_WINNT 0x0400
# endif # endif
@ -283,9 +283,6 @@ static unsigned int _strlen31(const char *str)
# ifdef OPENSSL_SYS_WINCE # ifdef OPENSSL_SYS_WINCE
# define OPENSSL_NO_POSIX_IO # define OPENSSL_NO_POSIX_IO
# if defined(_WIN32_WCE) && _WIN32_WCE<410
# include <winsock_extras.h>
# endif
# endif # endif
# define ssize_t long # define ssize_t long
@ -441,8 +438,16 @@ static unsigned int _strlen31(const char *str)
# define SHUTDOWN(fd) close(fd) # define SHUTDOWN(fd) close(fd)
# define SHUTDOWN2(fd) close(fd) # define SHUTDOWN2(fd) close(fd)
# elif !defined(__DJGPP__) # elif !defined(__DJGPP__)
# if defined(_WIN32_WCE) && _WIN32_WCE<410
# define getservbyname _masked_declaration_getservbyname
# endif
# include <winsock.h> # include <winsock.h>
extern HINSTANCE _hInstance; # ifdef getservbyname
# undef getservbyname
/* this is used to be wcecompat/include/winsock_extras.h */
struct servent* PASCAL getservbyname(const char*,const char*);
# endif
# ifdef _WIN64 # ifdef _WIN64
/* /*
* Even though sizeof(SOCKET) is 8, it's safe to cast it to int, because * Even though sizeof(SOCKET) is 8, it's safe to cast it to int, because

View File

@ -82,8 +82,8 @@ elsif ($FLAVOR =~ /CE/)
$cc='$(CC)'; $cc='$(CC)';
$base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT'; $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
$base_cflags.=" $wcecdefs"; $base_cflags.=" $wcecdefs";
$base_cflags.=' $(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'})); $base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'}));
$base_cflags.=' $(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'})); $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'}));
$opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics... $opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics...
$dbg_clfags=' /MC /Od -DDEBUG -D_DEBUG'; $dbg_clfags=' /MC /Od -DDEBUG -D_DEBUG';
$lflags="/nologo /opt:ref $wcelflag"; $lflags="/nologo /opt:ref $wcelflag";