Commit 0ede51f7 authored by Pekka Pessi's avatar Pekka Pessi

Updated Win32 port.

Added autogen.cmd, build_sources.cmd, version_files.cmd and version.awk.
Fixed problems with configuration.
Updated pthread-w32 to version 2.7.0.

darcs-hash:20060125162808-65a35-a6deb315c63375b8fc2c36cc0b203f97c2704165.gz
parent 321fc36a
......@@ -2,11 +2,19 @@
win32/README.txt / Sofia-SIP for win32
======================================
The win32 subdirectory contains the build envirponment for Win32 environment
The win32 subdirectory contains the build environment for Win32 environment
using MSVC. In order to compile the code with Windows 2000 SDK you have to
install so called "IPv6 Technology Preview for Windows 2000". The preview
contains updated IPv6 API in <tpipv6.h> and <wspiapi.h> header files.
http://msdn.microsoft.com/downloads/sdks/platform/tpipv6.asp
There is also a pthread implementation for Win32 included.
\ No newline at end of file
There is a pthread implementation for Visual C on Win32 included.
Source code and documentation for the pthread library can also be
downloaded from http://sources.redhat.com/pthreads-win32/.
The script autogen.cmd should be used to prepare source tree before
compiling Sofia SIP.
Currently, the SofiaSIP.dsw workspace creates a shared library for
sofia-sip-ua and a few test programs.
......@@ -30,6 +30,21 @@ Package=<4>
###############################################################################
Project: "test_nua"=".\tests\test_nua\test_nua.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libsofia_sip_ua
End Project Dependency
}}}
###############################################################################
Project: "su_alloc_test"=".\su\su_alloc_test\su_alloc_test.dsp" - Package Owner=<4>
Package=<5>
......
::
:: Prepare pristine Sofia SIP source tree for Visual C
::
:: NOTE: this script requires gawk - see http://unxutils.sourceforge.net
::
:: This file is part of the Sofia-SIP package
::
:: Copyright (C) 2005 Nokia Corporation.
::
:: Contact: Pekka Pessi <pekka.pessi@nokia.com>
::
:: This library is free software; you can redistribute it and/or
:: modify it under the terms of the GNU Lesser General Public License
:: as published by the Free Software Foundation; either version 2.1 of
:: the License, or (at your option) any later version.
::
:: This library is distributed in the hope that it will be useful, but
:: WITHOUT ANY WARRANTY; without even the implied warranty of
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
:: Lesser General Public License for more details.
::
:: You should have received a copy of the GNU Lesser General Public
:: License along with this library; if not, write to the Free Software
:: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
:: 02110-1301 USA
::
copy /Y su_configure_win32.h ..\libsofia-sip-ua\su\su_configure.h
call version_files.cmd
call build_sources.cmd
@echo Remember to install pthreadVC2.dll to your path, too!
::
:: Create built sources on win32
::
set MSG_AWK=gawk -v BINMODE=rw -f ../libsofia-sip-ua/msg/msg_parser.awk
set TAG_AWK=gawk -f ../libsofia-sip-ua/su/tag_dll.awk BINMODE=rw
set IN=../libsofia-sip-ua/msg/test_class.h
set PR=../libsofia-sip-ua/msg/test_protos.h
set PT=../libsofia-sip-ua/msg/test_table.c
%MSG_AWK% module=msg_test NO_MIDDLE=1 NO_LAST=1 ^
PR=%PR% %IN% < NUL
%MSG_AWK% module=msg_test prefix=msg MC_HASH_SIZE=127 multipart=msg_multipart ^
PT=%PT% %IN% < NUL
set IN=../libsofia-sip-ua/msg/msg_mime.h
set PR=../libsofia-sip-ua/msg/msg_protos.h
set PR2=../libsofia-sip-ua/msg/msg_mime_protos.h
set PT=../libsofia-sip-ua/msg/msg_mime_table.c
%MSG_AWK% module=msg NO_FIRST=1 NO_MIDDLE=1 PR=%PR% %IN% < NUL
%MSG_AWK% module=msg NO_FIRST=1 NO_LAST=1 PR=%PR2% %IN% < NUL
%MSG_AWK% module=msg_multipart tprefix=msg prefix=mp MC_HASH_SIZE=127 ^
PT=%PT% ../libsofia-sip-ua/msg/msg_mime.h < NUL
set IN=../libsofia-sip-ua/sip/sip.h
set PR=../libsofia-sip-ua/sip/sip_tag.c
set PR2=../libsofia-sip-ua/sip/sip_hclasses.h
set PR3=../libsofia-sip-ua/sip/sip_protos.h
set PR4=../libsofia-sip-ua/sip/sip_tag.h
set PT=../libsofia-sip-ua/sip/sip_parser_table.c
%MSG_AWK% module=sip PR=%PR% %IN% < NUL
%MSG_AWK% module=sip PR=%PR2% %IN% < NUL
%MSG_AWK% module=sip PR=%PR3% %IN% < NUL
%MSG_AWK% module=sip PR=%PR4% %IN% < NUL
%MSG_AWK% module=sip MC_HASH_SIZE=127 MC_SHORT_SIZE=26 ^
FLAGFILE=../libsofia-sip-ua/sip/sip_bad_mask ^
PT=%PT% %IN% < NUL
set IN=../libsofia-sip-ua/http/http.h
set PR=../libsofia-sip-ua/http/http_tag.c
set PR2=../libsofia-sip-ua/http/http_protos.h
set PR3=../libsofia-sip-ua/http/http_tag.h
set PT=../libsofia-sip-ua/http/http_parser_table.c
%MSG_AWK% module=http PR=%PR% %IN% < NUL
%MSG_AWK% module=http PR=%PR2% %IN% < NUL
%MSG_AWK% module=http PR=%PR3% %IN% < NUL
%MSG_AWK% module=http MC_HASH_SIZE=127 PT=%PT% %IN% < NUL
set P=../libsofia-sip-ua
%TAG_AWK% NO_DLL=1 %P%/http/http_tag.c < NUL
%TAG_AWK% NO_DLL=1 %P%/iptsec/auth_tag.c < NUL
%TAG_AWK% NO_DLL=1 %P%/msg/msg_tag.c < NUL
%TAG_AWK% NO_DLL=1 %P%/nea/nea_tag.c < NUL
%TAG_AWK% NO_DLL=1 LIST=nta_tag_list %P%/nta/nta_tag.c < NUL
%TAG_AWK% NO_DLL=1 %P%/nth/nth_tag.c < NUL
%TAG_AWK% NO_DLL=1 LIST=nua_tag_list %P%/nua/nua_tag.c < NUL
%TAG_AWK% NO_DLL=1 %P%/sdp/sdp_tag.c < NUL
%TAG_AWK% NO_DLL=1 %P%/sip/sip_tag.c < NUL
%TAG_AWK% NO_DLL=1 LIST=soa_tag_list %P%/soa/soa_tag.c < NUL
%TAG_AWK% NO_DLL=1 LIST=stun_tag_list %P%/stun/stun_tag.c < NUL
%TAG_AWK% NO_DLL=1 %P%/tport/tport_tag.c < NUL
%TAG_AWK% NO_DLL=1 %P%/url/url_tag.c < NUL
:end
\ No newline at end of file
......@@ -297,7 +297,7 @@
#define PACKAGE_STRING "@PACKAGE_STRING@"
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME "@PACKAGE_TARNAME@"
#define PACKAGE_TARNAME "@PACKAGE_TARNAME@"
/* Define to the version of this package. */
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
......@@ -312,7 +312,7 @@
#undef TIME_WITH_SYS_TIME
/* Version number of package */
#define VERSION @PACKAGE_VERSION@
#define VERSION "@PACKAGE_VERSION@"
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
......@@ -374,38 +374,9 @@
/* Define this as 1 if you have INTERFACE_INFO ioctl */
#define HAVE_INTERFACE_INFO (1)
#ifdef LIBSOFIA_SIP_UA_EXPORTS
/* We are compiling a DLL */
#define BNF_DLL __declspec(dllexport)
#define HTTP_DLL __declspec(dllexport)
#define IPT_DLL __declspec(dllexport)
#define AUTH_DLL __declspec(dllexport)
#define MSG_DLL __declspec(dllexport)
#define NEA_DLL __declspec(dllexport)
#define NTA_DLL __declspec(dllexport)
#define NTH_DLL __declspec(dllexport)
#define SDP_DLL __declspec(dllexport)
#define SIP_DLL __declspec(dllexport)
#define SU_DLL __declspec(dllexport)
#define TPORT_DLL __declspec(dllexport)
#define URL_DLL __declspec(dllexport)
#else /* elif defined(_LIB) */
#define BNF_DLL
#define HTTP_DLL
#define IPT_DLL
#define AUTH_DLL
#define MSG_DLL
#define NEA_DLL
#define NTA_DLL
#define NTH_DLL
#define SDP_DLL
#define SIP_DLL
#define SU_DLL
#define TPORT_DLL
#define URL_DLL
#endif
/* Ignore certain warnings */
#ifdef _MSC_VER
#pragma warning( disable : 4090 4204 4244 4018 4514 4706 4761)
#endif
......@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I ".." /I "..\..\libsofia-sip-ua\su" /I "..\..\libsofia-sip-ua\ipt" /I "..\..\libsofia-sip-ua\sresolv" /I "..\..\libsofia-sip-ua\bnf" /I "..\..\libsofia-sip-ua\url" /I "..\..\libsofia-sip-ua\msg" /I "..\..\libsofia-sip-ua\sip" /I "..\..\libsofia-sip-ua\nta" /I "..\..\libsofia-sip-ua\nua" /I "..\..\libsofia-sip-ua\iptsec" /I "..\..\libsofia-sip-ua\http" /I "..\..\libsofia-sip-ua\nth" /I "..\..\libsofia-sip-ua\nea" /I "..\..\libsofia-sip-ua\sdp" /I "..\..\libsofia-sip-ua\soa" /I "..\..\libsofia-sip-ua\stun" /I "..\..\libsofia-sip-ua\tport" /I "..\pthread" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I ".." /I "..\..\libsofia-sip-ua\su" /I "..\..\libsofia-sip-ua\ipt" /I "..\..\libsofia-sip-ua\sresolv" /I "..\..\libsofia-sip-ua\bnf" /I "..\..\libsofia-sip-ua\url" /I "..\..\libsofia-sip-ua\msg" /I "..\..\libsofia-sip-ua\sip" /I "..\..\libsofia-sip-ua\nta" /I "..\..\libsofia-sip-ua\nua" /I "..\..\libsofia-sip-ua\iptsec" /I "..\..\libsofia-sip-ua\http" /I "..\..\libsofia-sip-ua\nth" /I "..\..\libsofia-sip-ua\nea" /I "..\..\libsofia-sip-ua\sdp" /I "..\..\libsofia-sip-ua\soa" /I "..\..\libsofia-sip-ua\stun" /I "..\..\libsofia-sip-ua\tport" /I "..\..\libsofia-sip-ua\features" /I "..\pthread" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "LIBSOFIA_SIP_UA_STATIC" /D "IN_LIBSOFIA_SIP_UA" /FR /YX /FD /c
# ADD BASE RSC /l 0x40b /d "NDEBUG"
# ADD RSC /l 0x40b /d "NDEBUG"
BSC32=bscmake.exe
......@@ -64,7 +64,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /I "..\..\libsofia-sip-ua\su" /I "..\..\libsofia-sip-ua\ipt" /I "..\..\libsofia-sip-ua\sresolv" /I "..\..\libsofia-sip-ua\bnf" /I "..\..\libsofia-sip-ua\url" /I "..\..\libsofia-sip-ua\msg" /I "..\..\libsofia-sip-ua\sip" /I "..\..\libsofia-sip-ua\nta" /I "..\..\libsofia-sip-ua\nua" /I "..\..\libsofia-sip-ua\iptsec" /I "..\..\libsofia-sip-ua\http" /I "..\..\libsofia-sip-ua\nth" /I "..\..\libsofia-sip-ua\nea" /I "..\..\libsofia-sip-ua\sdp" /I "..\..\libsofia-sip-ua\soa" /I "..\..\libsofia-sip-ua\stun" /I "..\..\libsofia-sip-ua\tport" /I "..\pthread" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /I "..\..\libsofia-sip-ua\su" /I "..\..\libsofia-sip-ua\ipt" /I "..\..\libsofia-sip-ua\sresolv" /I "..\..\libsofia-sip-ua\bnf" /I "..\..\libsofia-sip-ua\url" /I "..\..\libsofia-sip-ua\msg" /I "..\..\libsofia-sip-ua\sip" /I "..\..\libsofia-sip-ua\nta" /I "..\..\libsofia-sip-ua\nua" /I "..\..\libsofia-sip-ua\iptsec" /I "..\..\libsofia-sip-ua\http" /I "..\..\libsofia-sip-ua\nth" /I "..\..\libsofia-sip-ua\nea" /I "..\..\libsofia-sip-ua\sdp" /I "..\..\libsofia-sip-ua\soa" /I "..\..\libsofia-sip-ua\stun" /I "..\..\libsofia-sip-ua\tport" /I "..\..\libsofia-sip-ua\features" /I "..\pthread" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "LIBSOFIA_SIP_UA_STATIC" /D "IN_LIBSOFIA_SIP_UA" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x40b /d "_DEBUG"
# ADD RSC /l 0x40b /d "_DEBUG"
BSC32=bscmake.exe
......@@ -100,6 +100,10 @@ SOURCE="..\..\libsofia-sip-ua\su\su.c"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\su_addrinfo.c"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\su_alloc.c"
# End Source File
# Begin Source File
......@@ -112,6 +116,10 @@ SOURCE="..\..\libsofia-sip-ua\su\su_default_log.c"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\su_errno.c"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\su_global_log.c"
# End Source File
# Begin Source File
......@@ -160,10 +168,6 @@ SOURCE="..\..\libsofia-sip-ua\su\su_tag_io.c"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\su_tag_ref.c"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\su_taglist.c"
# End Source File
# Begin Source File
......@@ -231,6 +235,14 @@ SOURCE="..\..\libsofia-sip-ua\url\url_tag.c"
SOURCE="..\..\libsofia-sip-ua\url\url_tag_ref.c"
# End Source File
# End Group
# Begin Group "features"
# PROP Default_Filter "features*.c"
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\features\sofia_sip_features.c"
# End Source File
# End Group
# Begin Group "bnf"
# PROP Default_Filter "bnf*.c"
......@@ -300,11 +312,15 @@ SOURCE="..\..\libsofia-sip-ua\msg\msg_tag.c"
# PROP Default_Filter ""
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\memcspn.c"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\memmem.c"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\msg\memspn.c"
SOURCE="..\..\libsofia-sip-ua\su\memspn.c"
# End Source File
# Begin Source File
......@@ -696,6 +712,10 @@ SOURCE="..\..\libsofia-sip-ua\su\su.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\su_addrinfo.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\su\su_alloc.h"
# End Source File
# Begin Source File
......@@ -840,15 +860,19 @@ SOURCE="..\..\libsofia-sip-ua\url\url.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\url\url_dll.h"
SOURCE="..\..\libsofia-sip-ua\url\url_tag.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\url\url_tag.h"
SOURCE="..\..\libsofia-sip-ua\url\url_tag_class.h"
# End Source File
# End Group
# Begin Group "features headers"
# PROP Default_Filter "features*.h"
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\url\url_tag_class.h"
SOURCE="..\..\libsofia-sip-ua\features\sofia_sip_features.h"
# End Source File
# End Group
# Begin Group "bnf headers"
......@@ -872,10 +896,6 @@ SOURCE="..\..\libsofia-sip-ua\msg\msg_addr.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\msg\msg_auth.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\msg\msg_bnf.h"
# End Source File
# Begin Source File
......@@ -888,10 +908,6 @@ SOURCE="..\..\libsofia-sip-ua\msg\msg_date.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\msg\msg_dll.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\msg\msg_header.h"
# End Source File
# Begin Source File
......@@ -940,10 +956,6 @@ SOURCE="..\..\libsofia-sip-ua\sip\sip.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\sip\sip_dll.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\sip\sip_extensions.h"
# End Source File
# Begin Source File
......@@ -992,10 +1004,6 @@ SOURCE="..\..\libsofia-sip-ua\http\http.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\http\http_dll.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\http\http_hclasses.h"
# End Source File
# Begin Source File
......@@ -1068,10 +1076,6 @@ SOURCE="..\..\libsofia-sip-ua\iptsec\auth_digest.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\iptsec\auth_dll.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\iptsec\auth_module.h"
# End Source File
# Begin Source File
......@@ -1120,10 +1124,6 @@ SOURCE="..\..\libsofia-sip-ua\nta\nta.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\nta\nta_dll.h"
# End Source File
# Begin Source File
SOURCE="..\..\libsofia-sip-ua\nta\nta_internal.h"
# End Source File
# Begin Source File
......
......@@ -88,7 +88,7 @@ SOURCE="..\..\libsofia-sip-ua\nta\test_nta.c"
# End Source File
# Begin Source File
SOURCE=..\pthread\pthread.lib
SOURCE=..\pthread\pthreadVC2.lib
# End Source File
# End Target
# End Project
; pthread.def
; Last updated: $Date: 2001/02/23 13:23:36 $
; Currently unimplemented functions are commented out.
LIBRARY pthread
EXPORTS
;pthread_atfork
pthread_attr_destroy
pthread_attr_getdetachstate
;pthread_attr_getinheritsched
pthread_attr_getschedparam
;pthread_attr_getschedpolicy
;pthread_attr_getscope
pthread_attr_getstackaddr
pthread_attr_getstacksize
pthread_attr_init
pthread_attr_setdetachstate
;pthread_attr_setinheritsched
pthread_attr_setschedparam
;pthread_attr_setschedpolicy
;pthread_attr_setscope
pthread_attr_setstackaddr
pthread_attr_setstacksize
pthread_cancel
;
; These are implemented as macros
;
;pthread_cleanup_pop
;pthread_cleanup_push
;
pthread_condattr_destroy
pthread_condattr_getpshared
pthread_condattr_init
pthread_condattr_setpshared
pthread_cond_broadcast
pthread_cond_destroy
pthread_cond_init
pthread_cond_signal
pthread_cond_timedwait
pthread_cond_wait
pthread_create
pthread_detach
pthread_equal
pthread_exit
pthread_getschedparam
pthread_getspecific
pthread_join
pthread_key_create
pthread_key_delete
;pthread_kill
pthread_mutexattr_destroy
;pthread_mutexattr_getprioceiling
;pthread_mutexattr_getprotocol
pthread_mutexattr_getpshared
pthread_mutexattr_init
;pthread_mutexattr_setprioceiling
;pthread_mutexattr_setprotocol
pthread_mutexattr_setpshared
pthread_mutexattr_destroy
pthread_mutex_init
pthread_mutex_destroy
pthread_mutex_lock
pthread_mutex_trylock
pthread_mutex_unlock
pthread_once
pthread_self
pthread_setcancelstate
pthread_setcanceltype
pthread_setschedparam
pthread_setspecific
;pthread_sigmask
pthread_testcancel
;
; POSIX 1.b
;
sched_get_priority_min
sched_get_priority_max
sched_yield
sem_init
sem_destroy
sem_trywait
sem_wait
sem_post
sem_open
sem_close
sem_unlink
sem_getvalue
;
; Read/Write Locks
;
pthread_rwlock_init
pthread_rwlock_destroy
pthread_rwlock_tryrdlock
pthread_rwlock_trywrlock
pthread_rwlock_rdlock
pthread_rwlock_wrlock
pthread_rwlock_unlock
;
; Non-portable but useful
;
pthread_mutexattr_setforcecs_np
pthreadCancelableWait
pthreadCancelableTimedWait
;
; Needed if !defined(_MSC_VER) && !defined(__cplusplus)
;
pthread_push_cleanup
pthread_pop_cleanup
This diff is collapsed.
......@@ -7,67 +7,172 @@
*
* POSIX 1003.1b-1993 (POSIX.1b)
*
* --------------------------------------------------------------------------
*
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright (C) 1998
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
*
* Contact Email: rpj@callisto.canberra.edu.au
*
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifndef _SCHED_H
#define _SCHED_H
#ifdef _MSC_VER
#undef PTW32_LEVEL
#if defined(_POSIX_SOURCE)
#define PTW32_LEVEL 0
/* Early POSIX */
#endif
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309
#undef PTW32_LEVEL
#define PTW32_LEVEL 1
/* Include 1b, 1c and 1d */
#endif
#if defined(INCLUDE_NP)
#undef PTW32_LEVEL
#define PTW32_LEVEL 2
/* Include Non-Portable extensions */
#endif
#define PTW32_LEVEL_MAX 3
#if !defined(PTW32_LEVEL)
#define PTW32_LEVEL PTW32_LEVEL_MAX
/* Include everything */
#endif
#if __GNUC__ && ! defined (__declspec)
# error Please upgrade your GNU compiler to one that supports __declspec.
#endif
/*
* Disable following warnings when including Windows headers
*
* warning C4115: named type definition in parentheses
* warning C4116: unnamed type definition in parentheses
* warning C4127: conditional expression is constant
* warning C4201: nonstandard extension used : nameless struct/union
* warning C4214: nonstandard extension used : bit field types other than int
* warning C4514: unreferenced inline function has been removed
* When building the DLL code, you should define PTW32_BUILD so that
* the variables/functions are exported correctly. When using the DLL,
* do NOT define PTW32_BUILD, and then the variables/functions will
* be imported correctly.
*/
#pragma warning( disable : 4115 4116 4127 4201 4214 4514)
#ifndef PTW32_STATIC_LIB
# ifdef PTW32_BUILD
# define PTW32_DLLPORT __declspec (dllexport)
# else
# define PTW32_DLLPORT __declspec (dllimport)
# endif
#else
# define PTW32_DLLPORT
#endif
#include <windows.h>
#include <process.h>
#include <errno.h>
/*
* This is a duplicate of what is in the autoconf config.h,
* which is only used when building the pthread-win32 libraries.
*/
#ifndef PTW32_CONFIG_H
# if defined(WINCE)
# define NEED_ERRNO
# define NEED_SEM
# endif
# if defined(_UWIN) || defined(__MINGW32__)
# define HAVE_MODE_T
# endif
#endif
#ifdef _MSC_VER
/*
* Re-enable all but 4127, 4514
*
*/
#pragma warning( default : 4115 4116 4201 4214)
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
#ifdef NEED_ERRNO
#include "need_errno.h"
#else
#include <errno.h>
#endif
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
#if defined(__MINGW32__) || defined(_UWIN)
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
/* For pid_t */
# include <sys/types.h>
/* Required by Unix 98 */
# include <time.h>
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
#else
typedef int pid_t;
#endif
/* Thread scheduling policies */
enum {
SCHED_OTHER = 0,
SCHED_FIFO,
SCHED_RR,
SCHED_MIN = SCHED_OTHER,
SCHED_MAX = SCHED_RR
};
struct sched_param {
int sched_priority;
};
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
int sched_yield (void);
PTW32_DLLPORT int __cdecl sched_yield (void);
int sched_get_priority_min (int policy);
PTW32_DLLPORT int __cdecl sched_get_priority_min (int policy);
int sched_get_priority_max (int policy);
PTW32_DLLPORT int __cdecl sched_get_priority_max (int policy);
PTW32_DLLPORT int __cdecl sched_setscheduler (pid_t pid, int policy);
PTW32_DLLPORT int __cdecl sched_getscheduler (pid_t pid);
/*
* Note that this macro returns ENOTSUP rather than
* ENOSYS as might be expected. However, returning ENOSYS
* should mean that sched_get_priority_{min,max} are
* not implemented as well as sched_rr_get_interval.
* This is not the case, since we just don't support
* round-robin scheduling. Therefore I have chosen to
* return the same value as sched_setscheduler when
* SCHED_RR is passed to it.
*/
#define sched_rr_get_interval(_pid, _interval) \
( errno = ENOTSUP, (int) -1 )
#ifdef __cplusplus
} /* End of extern "C" */
#endif /* __cplusplus */
#undef PTW32_LEVEL
#undef PTW32_LEVEL_MAX
#endif /* !_SCHED_H */
......@@ -7,29 +7,110 @@
*
* POSIX 1003.1b-1993 (POSIX.1b)
*
* --------------------------------------------------------------------------
*
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright (C) 1998
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
*
* Contact Email: rpj@callisto.canberra.edu.au
*
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined( SEMAPHORE_H )
#define SEMAPHORE_H
#include <process.h>
#undef PTW32_LEVEL
#if defined(_POSIX_SOURCE)
#define PTW32_LEVEL 0
/* Early POSIX */
#endif
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309
#undef PTW32_LEVEL
#define PTW32_LEVEL 1
/* Include 1b, 1c and 1d */
#endif