win32.h

00001 /*
00002  *  Copyright (C) 2006  Helmut Grohne
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 #ifndef __WIN32__
00020 #error "this include is only for win32"
00021 #endif
00022 
00023 #ifndef LIBMUTH_WIN32_H
00024 #define LIBMUTH_WIN32_H
00025 
00026 #define LIBMUTH_NEED_UINT64_T
00027 #define LIBMUTH_NEED_SOCKLEN_T
00028 #define LIBMUTH_NEED_SUSECONDS_T
00029 /* #define LIBMUTH_NEED_SIZE_T */
00030 #define LIBMUTH_NEED_SSIZE_T
00031 
00032 #ifndef NOMINMAX
00033 #define NOMINMAX
00034 #endif
00035 #include <windows.h>
00036 #include <winsock.h>
00037 
00038 #ifdef LIBMUTH_NEED_UINT64_T
00039 /* Windows doesn't seem to be able to handle long long, so this uint64_t will
00040  * have only 32 bits. */
00041 typedef unsigned long uint64_t;
00042 #endif
00043 #ifdef LIBMUTH_NEED_SOCKLEN_T
00044 typedef int socklen_t;
00045 #endif
00046 #ifdef LIBMUTH_NEED_SUSECONDS_T
00047 typedef long suseconds_t;
00048 #endif
00049 #ifdef LIBMUTH_NEED_SIZE_T
00050 typedef unsigned long size_t;
00051 #endif
00052 #ifdef LIBMUTH_NEED_SSIZE_T
00053 typedef long ssize_t;
00054 #endif
00055 
00056 typedef struct {
00057         void *ss_sp;
00058         size_t ss_size;
00059         int ss_flags;
00060 } stack_t;
00061 
00062 typedef unsigned long __sigset_t;
00063 
00064 typedef struct {
00065         stack_t uc_stack;
00066         CONTEXT winctx;
00067 } ucontext_t;
00068 
00069 int getcontext(ucontext_t *ucp);
00070 int setcontext(const ucontext_t *ucp);
00071 int makecontext(ucontext_t *, void (*)(), int, ...);
00072 int swapcontext(ucontext_t *, const ucontext_t *);
00073 
00074 #endif

Generated on Sat Feb 7 01:26:50 2009 by  doxygen 1.5.1