Ignore:
Timestamp:
2000-07-13T10:21:53+12:00 (24 years ago)
Author:
sjboddie
Message:

merged changes to trunk into New_Config_Format branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New_Config_Format-branch/gsdl/lib/gsdlconf.h

    r1076 r1279  
    3030#define GSDLCONF_H
    3131
    32 #ifndef __WIN32__
     32#if defined(__WIN32__)
     33#include "../win32cfg.h"
     34#else
    3335#include "../config.h"
    3436#endif
     
    7880#endif
    7981
     82// mktemp
     83
     84#if !defined(__WIN32__) || defined(__GNUC__)
     85#include <unistd.h>
     86#define GSDL_MKTEMP(str) mktemp(str)
     87#else
     88#include <io.h>
     89#define GSDL_MKTEMP(str) _mktemp(str)
     90#endif
     91
     92
    8093
    8194// file locking
    8295
    8396#if defined(__WIN32__)
     97
     98#if !defined(LK_UNLOCK) && defined(LK_UNLCK)
     99#define LK_UNLOCK LK_UNLCK
     100#endif
     101
     102#if defined (GSDL_USE_IOS_H)
    84103#include <io.h>
    85104#include <sys/locking.h>
     105
     106#if defined(__GNUC__)
     107#define GSDL_GET_FILEDESC(str) str.filedesc()
     108#else
    86109#define GSDL_GET_FILEDESC(str) str.fd()
     110#endif
     111
    87112#define GSDL_UNLOCK_FILE(fd) _locking(fd, LK_UNLCK, 200)
    88113#define GSDL_LOCK_FILE(fd) lock_val = _locking(fd, LK_NBLCK, 200)
     114
     115#else
     116
     117// when using <fstream> (i.e. VC++ 6.0) I can't work out how
     118// to return a filedesc. File locking won't currently work
     119// for those windows compilers requiring GSDL_USE_IOS_H to
     120// not be set -- Stefan.
     121#define GSDL_GET_FILEDESC(str) 1
     122#define GSDL_LOCK_FILE(fd) lock_val = 0
     123#define GSDL_UNLOCK_FILE(fd) 0
     124#endif
    89125
    90126#else
Note: See TracChangeset for help on using the changeset viewer.