Changeset 725


Ignore:
Timestamp:
Sep 26, 2013, 6:49:38 PM (9 years ago)
Author:
Sam Hocevar
Message:

build: Win32 compilation fixes.

Location:
abuse/branches/lol/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • abuse/branches/lol/src/imlib/specs.cpp

    r724 r725  
    297297  char tmp_name[200];
    298298  if (spec_prefix && filename[0] != '/')
    299     sprintf(tmp_name,"%s%s",spec_prefix,filename);
    300   else strcpy(tmp_name,filename);
     299    sprintf(tmp_name, "%s%s", spec_prefix, filename);
     300  else
     301    strcpy(tmp_name, filename);
    301302
    302303//  int old_mask=umask(S_IRWXU | S_IRWXG | S_IRWXO);
    303   if (flags&O_WRONLY)
    304   {
    305     if ((flags&O_APPEND)==0)
    306     {
    307       skip_size=1;
     304  if (flags & O_WRONLY)
     305  {
     306    if ((flags & O_APPEND) == 0)
     307    {
     308      skip_size = 1;
    308309      //int errval = unlink(tmp_name);
    309310    }
    310311
    311     flags-=O_WRONLY;
    312     flags|=O_CREAT|O_RDWR;
    313 
    314     fd=open(tmp_name,flags,S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
    315   } else
    316     fd=open(tmp_name,flags);
     312    flags &= ~O_WRONLY;
     313    flags |= O_CREAT | O_RDWR;
     314
     315#if defined S_IRUSR && defined S_IRGRP && defined S_IROTH
     316    fd = open(tmp_name, flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
     317#else
     318    fd = open(tmp_name, flags);
     319#endif
     320  }
     321  else
     322  {
     323    fd = open(tmp_name, flags);
     324  }
    317325
    318326//  umask(old_mask);
    319   if (fd>=0 && !skip_size)
     327  if (fd >= 0 && !skip_size)
    320328  {
    321329    file_length=lseek(fd,0,SEEK_END);
  • abuse/branches/lol/src/level.cpp

    r724 r725  
    21552155            }
    21562156            delete bk;
    2157 #if (defined(__MACH__) || !defined(__APPLE__))
     2157#if defined S_IRUSR && defined S_IRGRP && defined S_IROTH
    21582158            chmod( bkname, S_IRWXU | S_IRWXG | S_IRWXO );
    21592159#endif
     
    22442244
    22452245            delete fp;
    2246 #if (defined(__MACH__) || !defined(__APPLE__))
     2246#if defined S_IRUSR && defined S_IRGRP && defined S_IROTH
    22472247            chmod( name, S_IRWXU | S_IRWXG | S_IRWXO );
    22482248#endif
  • abuse/branches/lol/src/sdlport/setup.cpp

    r724 r725  
    282282        {
    283283            // FIXME: Add some error checking here
    284             mkdir( savedir, S_IRUSR | S_IWUSR | S_IXUSR );
     284#if defined S_IRUSR && defined S_IRGRP && defined S_IROTH
     285            mkdir(savedir, S_IRUSR | S_IWUSR | S_IXUSR);
     286#else
     287            mkdir(savedir);
     288#endif
    285289        }
    286290        else
  • abuse/branches/lol/src/sdlport/sound.cpp

    r724 r725  
    2525#include <cstring>
    2626
    27 #include <SDL.h>
    28 #include <SDL/SDL_mixer.h>
    29 
    3027#include "common.h"
    3128
     
    113110        return;
    114111
     112#if defined USE_SDL_MIXER
    115113    jFILE fp(filename, "rb");
    116114    if (fp.open_failure())
     
    122120    m_chunk = Mix_LoadWAV_RW(rw, 1);
    123121    free(temp_data);
     122#endif
    124123}
    125124
     
    140139    // on a level load will cut off in the middle. This is most noticable
    141140    // for the button sound of the load savegame dialog.
     141#if defined USE_SDL_MIXER
    142142    Mix_FadeOutGroup(-1, 100);
    143143    while (Mix_Playing(-1))
    144144        SDL_Delay(10);
    145145    Mix_FreeChunk(m_chunk);
     146#endif
    146147}
    147148
     
    160161        return;
    161162
     163#if defined USE_SDL_MIXER
    162164    int channel = Mix_PlayChannel(-1, m_chunk, 0);
    163165    if (channel > -1)
     
    166168        Mix_SetPanning(channel, panpot, 255 - panpot);
    167169    }
     170#endif
    168171}
    169172
  • abuse/branches/lol/src/view.cpp

    r724 r725  
    1414
    1515#if defined HAVE_UNISTD_H
    16 #   include <unistd.h>
     16#   include <unistd.h> /* for getlogin() */
    1717#endif
    1818
     
    176176        return cur_user_name;
    177177
    178 #if defined __CELLOS_LV2__
     178    /* For some reason mingw has getlogin() in its libs but not in unistd.h,
     179     * so I check for both to make sure. */
     180#if defined HAVE_GETLOGIN && !defined _WIN32
     181    char const *login = getlogin();
     182    return login ? login : "unknown";
     183#else
    179184    /* FIXME: retrieve login name */
    180185    return "Player";
    181 #else
    182     char const *login = getlogin();
    183     return login ? login : "unknown";
    184186#endif
    185187}
Note: See TracChangeset for help on using the changeset viewer.