]> granicus.if.org Git - transmission/commitdiff
mmap portability changes by Spry
authorCharles Kerr <charles@transmissionbt.com>
Tue, 14 Oct 2008 17:30:07 +0000 (17:30 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Tue, 14 Oct 2008 17:30:07 +0000 (17:30 +0000)
libtransmission/platform.c

index d7a303dfb35e81ad8f6c9dbefb9af1ab0dd41187..e6242ad9359bb12e1b5dcc03514fe7515b0188eb 100644 (file)
@@ -637,7 +637,11 @@ tr_lockfile( const char * filename )
  * his paper at: http://www.genesys-e.de/jwalter/mix4win.htm
  */
 
+#if defined(_MSC_VER)
+__declspec( align( 4 ) ) static LONG volatile g_sl;
+#else
 static LONG volatile g_sl __attribute__ ( ( aligned ( 4 ) ) );
+#endif
 
 /* Wait for spin lock */
 static int
@@ -651,7 +655,7 @@ slwait( LONG volatile *sl )
 
 /* Release spin lock */
 static int
-slrelease( LONG *sl )
+slrelease( LONG volatile *sl )
 {
     InterlockedExchange ( sl, 0 );
     return 0;