Ignore:
Timestamp:
Jul 4, 2014, 12:00:07 AM (7 years ago)
Author:
livings124
Message:

Use built-in _WIN32 macro instead of WIN32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform.c

    r14310 r14316  
    2020#include <sys/stat.h>
    2121
    22 #ifdef WIN32
     22#ifdef _WIN32
    2323 #include <w32api.h>
    2424 #define WINVER  WindowsXP
     
    3535#endif
    3636
    37 #ifdef WIN32
     37#ifdef _WIN32
    3838#include <libgen.h> /* dirname() */
    3939#endif
     
    4949***/
    5050
    51 #ifdef WIN32
     51#ifdef _WIN32
    5252typedef DWORD tr_thread_id;
    5353#else
     
    5858tr_getCurrentThread (void)
    5959{
    60 #ifdef WIN32
     60#ifdef _WIN32
    6161  return GetCurrentThreadId ();
    6262#else
     
    6868tr_areThreadsEqual (tr_thread_id a, tr_thread_id b)
    6969{
    70 #ifdef WIN32
     70#ifdef _WIN32
    7171  return a == b;
    7272#else
     
    8181  void           * arg;
    8282  tr_thread_id     thread;
    83 #ifdef WIN32
     83#ifdef _WIN32
    8484  HANDLE           thread_handle;
    8585#endif
     
    9292}
    9393
    94 #ifdef WIN32
     94#ifdef _WIN32
    9595 #define ThreadFuncReturnType unsigned WINAPI
    9696#else
     
    106106
    107107  tr_free (t);
    108 #ifdef WIN32
     108#ifdef _WIN32
    109109  _endthreadex (0);
    110110  return 0;
     
    120120  t->arg  = arg;
    121121
    122 #ifdef WIN32
     122#ifdef _WIN32
    123123  {
    124124    unsigned int id;
     
    142142{
    143143  int                 depth;
    144 #ifdef WIN32
     144#ifdef _WIN32
    145145  CRITICAL_SECTION    lock;
    146146  DWORD               lockThread;
     
    156156  tr_lock * l = tr_new0 (tr_lock, 1);
    157157
    158 #ifdef WIN32
     158#ifdef _WIN32
    159159  InitializeCriticalSection (&l->lock); /* supports recursion */
    160160#else
     
    171171tr_lockFree (tr_lock * l)
    172172{
    173 #ifdef WIN32
     173#ifdef _WIN32
    174174    DeleteCriticalSection (&l->lock);
    175175#else
     
    182182tr_lockLock (tr_lock * l)
    183183{
    184 #ifdef WIN32
     184#ifdef _WIN32
    185185  EnterCriticalSection (&l->lock);
    186186#else
     
    209209  --l->depth;
    210210  assert (l->depth >= 0);
    211 #ifdef WIN32
     211#ifdef _WIN32
    212212  LeaveCriticalSection (&l->lock);
    213213#else
     
    220220***/
    221221
    222 #ifndef WIN32
     222#ifndef _WIN32
    223223 #include <pwd.h>
    224224#endif
     
    235235      if (!home)
    236236        {
    237 #ifdef WIN32
     237#ifdef _WIN32
    238238          char appdata[MAX_PATH]; /* SHGetFolderPath () requires MAX_PATH */
    239239          *appdata = '\0';
     
    315315#ifdef __APPLE__
    316316          s = tr_buildPath (getHomeDir (), "Library", "Application Support", appname, NULL);
    317 #elif defined (WIN32)
     317#elif defined (_WIN32)
    318318          char appdata[TR_PATH_MAX]; /* SHGetFolderPath () requires MAX_PATH */
    319319          SHGetFolderPath (NULL, CSIDL_APPDATA, NULL, 0, appdata);
     
    459459            }
    460460
    461 #elif defined (WIN32)
     461#elif defined (_WIN32)
    462462
    463463          /* SHGetFolderPath explicitly requires MAX_PATH length */
     
    566566
    567567
    568 #ifdef WIN32
     568#ifdef _WIN32
    569569
    570570/* The following mmap functions are by Joerg Walter, and were taken from
Note: See TracChangeset for help on using the changeset viewer.