Browse files

MSVC2010 projects adjusted to allow pthread.c concatenated source com…

…pile (for tighter builds) + corrections to prevent 'empty build unit' errors + added new tests to the monolithic test app.
  • Loading branch information...
1 parent 1d64a31 commit c93f4778e0b7600894053e034e455ae5abc0510a @GerHobbelt committed Sep 29, 2012
View
4 errno.c
@@ -35,11 +35,11 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#if defined(NEED_ERRNO)
-
#include "pthread.h"
#include "implement.h"
+#if defined(NEED_ERRNO)
+
static int reallyBad = ENOMEM;
/*
View
1,380 pthread.2010.vcxproj
1,156 additions, 224 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
388 pthread.2010.vcxproj.filters
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{ddcae617-25bc-4bc8-a86e-2eac1b5cff07}</UniqueIdentifier>
- <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
- </Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{40973b82-2e91-4980-85ce-632bd47beede}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
@@ -16,6 +12,198 @@
<Filter Include="Documentation">
<UniqueIdentifier>{8c2f3157-28a1-42fa-b6ef-565d1330e9c4}</UniqueIdentifier>
</Filter>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{50e4ffe4-d62c-4c85-a890-f7c6849dccbb}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="context.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="implement.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="need_errno.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pthread.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="sched.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="semaphore.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="manual\index.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\PortabilityIssues.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_attr_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_attr_setstackaddr.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_attr_setstacksize.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_barrier_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_barrier_wait.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_barrierattr_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_barrierattr_setpshared.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_cancel.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_cleanup_push.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_cond_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_condattr_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_condattr_setpshared.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_create.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_delay_np.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_detach.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_equal.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_exit.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_getw32threadhandle_np.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_join.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_key_create.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_kill.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_mutex_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_mutexattr_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_mutexattr_setpshared.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_num_processors_np.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_once.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_rwlock_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_rwlock_rdlock.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_rwlock_timedrdlock.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_rwlock_timedwrlock.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_rwlock_unlock.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_rwlock_wrlock.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_rwlockattr_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_rwlockattr_setpshared.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_self.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_setcancelstate.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_setcanceltype.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_setconcurrency.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_setschedparam.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_spin_init.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_spin_lock.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_spin_unlock.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_timechange_handler_np.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_win32_attach_detach_np.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthread_win32_test_features_np.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\pthreadCancelableWait.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\sched_get_priority_max.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\sched_getscheduler.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\sched_setscheduler.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\sched_yield.html">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="manual\sem_init.html">
+ <Filter>Documentation</Filter>
+ </None>
</ItemGroup>
<ItemGroup>
<ClCompile Include="attr.c">
@@ -480,194 +668,8 @@
<ClCompile Include="w32_CancelableWait.c">
<Filter>Source Files</Filter>
</ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="config.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="context.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="implement.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="need_errno.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="pthread.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="sched.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="semaphore.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="version.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- </ItemGroup>
- <ItemGroup>
- <None Include="manual\index.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\PortabilityIssues.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_attr_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_attr_setstackaddr.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_attr_setstacksize.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_barrier_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_barrier_wait.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_barrierattr_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_barrierattr_setpshared.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_cancel.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_cleanup_push.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_cond_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_condattr_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_condattr_setpshared.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_create.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_delay_np.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_detach.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_equal.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_exit.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_getw32threadhandle_np.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_join.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_key_create.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_kill.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_mutex_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_mutexattr_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_mutexattr_setpshared.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_num_processors_np.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_once.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_rwlock_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_rwlock_rdlock.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_rwlock_timedrdlock.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_rwlock_timedwrlock.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_rwlock_unlock.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_rwlock_wrlock.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_rwlockattr_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_rwlockattr_setpshared.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_self.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_setcancelstate.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_setcanceltype.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_setconcurrency.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_setschedparam.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_spin_init.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_spin_lock.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_spin_unlock.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_timechange_handler_np.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_win32_attach_detach_np.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthread_win32_test_features_np.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\pthreadCancelableWait.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\sched_get_priority_max.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\sched_getscheduler.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\sched_setscheduler.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\sched_yield.html">
- <Filter>Documentation</Filter>
- </None>
- <None Include="manual\sem_init.html">
- <Filter>Documentation</Filter>
- </None>
+ <ClCompile Include="pthread_timedjoin_np.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
</Project>
View
1,236 pthread_lib.2010.vcxproj
1,084 additions, 152 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
3 pthread_lib.2010.vcxproj.filters
@@ -480,6 +480,9 @@
<ClCompile Include="w32_CancelableWait.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="pthread_timedjoin_np.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="config.h">
View
2 tests/Debug.2010.vcxproj
@@ -471,6 +471,7 @@
<ClCompile Include="exception1.c" />
<ClCompile Include="exception2.c" />
<ClCompile Include="exception3.c" />
+ <ClCompile Include="exception3_0.c" />
<ClCompile Include="exit1.c" />
<ClCompile Include="exit2.c" />
<ClCompile Include="exit3.c" />
@@ -482,6 +483,7 @@
<ClCompile Include="join1.c" />
<ClCompile Include="join2.c" />
<ClCompile Include="join3.c" />
+ <ClCompile Include="join4.c" />
<ClCompile Include="kill1.c" />
<ClCompile Include="loadfree.c" />
<ClCompile Include="mutex1.c" />
View
6 tests/Debug.2010.vcxproj.filters
@@ -492,6 +492,12 @@
<ClCompile Include="create3a.c">
<Filter>TestSources</Filter>
</ClCompile>
+ <ClCompile Include="exception3_0.c">
+ <Filter>TestSources</Filter>
+ </ClCompile>
+ <ClCompile Include="join4.c">
+ <Filter>TestSources</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="benchtest.h">
View
15 tests/exception3_0.c
@@ -93,10 +93,10 @@ enum {
NUMTHREADS = 10
};
-int caught = 0;
-CRITICAL_SECTION caughtLock;
+static int caught = 0;
+static CRITICAL_SECTION caughtLock;
-void
+static void
terminateFunction ()
{
EnterCriticalSection(&caughtLock);
@@ -125,7 +125,7 @@ terminateFunction ()
exit(0);
}
-void *
+static void *
exceptionedThread(void * arg)
{
int dummy = 0x1;
@@ -175,8 +175,13 @@ test_exception3_0(void)
#include <stdio.h>
+#ifndef MONOLITHIC_PTHREAD_TESTS
int
-main()
+ main()
+#else
+int
+ test_exception3_0(void)
+#endif
{
fprintf(stderr, "Test N/A for this compiler environment.\n");
return 0;
View
11 tests/join4.c
@@ -38,15 +38,20 @@
#include "test.h"
-void *
+static void *
func(void * arg)
{
Sleep(1200);
return arg;
}
-int
-main(int argc, char * argv[])
+#ifndef MONOLITHIC_PTHREAD_TESTS
+int
+ main()
+#else
+int
+ test_join4(void)
+#endif
{
pthread_t id;
struct timespec abstime;
View
4 tests/wrapper4tests_1.c
@@ -73,6 +73,7 @@ int test_errno1(void);
int test_exception1(void);
int test_exception2(int argc, char **argv);
int test_exception3(void);
+int test_exception3_0(void);
int test_exit1(void);
int test_exit2(void);
int test_exit3(void);
@@ -84,6 +85,7 @@ int test_join0(void);
int test_join1(void);
int test_join2(void);
int test_join3(void);
+int test_join4(void);
int test_kill1(void);
int test_loadfree(void);
int test_mutex1(void);
@@ -309,6 +311,7 @@ int main(int argc, char **argv)
TEST_WRAPPER(test_errno1);
// TEST_WRAPPER(test_exception1);
TEST_WRAPPER(test_exception3);
+ TEST_WRAPPER(test_exception3_0);
TEST_WRAPPER(test_exit2);
TEST_WRAPPER(test_exit3);
TEST_WRAPPER(test_exit4);
@@ -319,6 +322,7 @@ int main(int argc, char **argv)
TEST_WRAPPER(test_join1);
TEST_WRAPPER(test_join2);
TEST_WRAPPER(test_join3);
+ TEST_WRAPPER(test_join4);
TEST_WRAPPER(test_kill1);
// TEST_WRAPPER(test_loadfree);
TEST_WRAPPER(test_mutex1);

0 comments on commit c93f477

Please sign in to comment.