Changeset 3ff334 in git


Ignore:
Timestamp:
Apr 9, 1998, 1:47:13 PM (26 years ago)
Author:
Wilfred Pohl <pohl@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
e0bce7d14f8856bbd5f033cdbdad34575973fc57
Parents:
bf2cb0afbd85758686649544bac7e2f6dd6abc9f
Message:
generalisation to Metrowerks with WindowsNT


git-svn-id: file:///usr/local/Singular/svn/trunk@1367 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/ndbm.cc

    rbf2cb0 r3ff334  
    55//**************************************************************************/
    66//
    7 // $Id: ndbm.cc,v 1.8 1998-01-27 15:34:08 pohl Exp $
     7// $Id: ndbm.cc,v 1.9 1998-04-09 11:47:13 pohl Exp $
    88//
    99//**************************************************************************/
     
    3030
    3131#include <stdio.h>
     32#ifdef __MWERKS__
     33#   define bcopy(a,b,c) memmove(b,a,c)
     34#   define EPERM 1
     35#   define ENOMEM 23
     36#   define ENOSPC 28
     37#   define L_SET SEEK_SET
    3238#ifdef macintosh
    3339#   include <stdlib.h>
     
    3642#   include <string.h>
    3743#   include <stat.h>
    38 #   define L_SET SEEK_SET
    39 #   define EPERM 1
    40 #   define ENOSPC 28
    41 #   define ENOMEM 23
    42 #   define bcopy(a,b,c) memmove(b,a,c)
    43 #else /* not macintosh */
     44//#   include <stat.h>
     45#else
     46#   include <unix.h>
     47#   include <ThreadLocalData.h>
     48#endif
     49#else
    4450#   include <sys/types.h>
    4551#   include <sys/stat.h>
     
    5056#   include <unistd.h>
    5157#   include <fcntl.h>
    52 #endif /* macintosh */
     58#endif
    5359#ifndef HAVE_BCOPY
    5460#   define bcopy(a,b,c) memmove(b,a,c)
     
    6874static  int delitem(char buf[PBLKSIZ], int n);
    6975static  int additem(char buf[PBLKSIZ], datum item, datum item1);
     76#if defined(__MWERKS__) && ! defined(macintosh)
     77#define errno (_GetThreadLocalData()->errno)
     78#else
    7079extern  int errno;
    71 
     80#endif
    7281
    7382DBM *
     
    96105  strcpy(db->dbm_pagbuf, file);
    97106  strcat(db->dbm_pagbuf, ".pag");
    98 #ifdef macintosh
     107#ifdef __MWERKS__
    99108  db->dbm_pagf = open(db->dbm_pagbuf, flags);
    100 #else /* not macintosh */
     109#else /* not __MWERKS__ */
    101110  db->dbm_pagf = open(db->dbm_pagbuf, flags, mode);
    102 #endif /* macintosh */
     111#endif /* __MWERKS__ */
    103112  if (db->dbm_pagf < 0)
    104113    goto bad;
    105114  strcpy(db->dbm_pagbuf, file);
    106115  strcat(db->dbm_pagbuf, ".dir");
    107 #ifdef macintosh
     116#ifdef __MWERKS__
    108117  db->dbm_dirf = open(db->dbm_pagbuf, flags);
    109 #else /* not macintosh */
     118#else /* not __MWERKS__ */
    110119  db->dbm_dirf = open(db->dbm_pagbuf, flags, mode);
    111 #endif /* macintosh */
     120#endif /* __MWERKS__ */
    112121  if (db->dbm_dirf < 0)
    113122    goto bad1;
Note: See TracChangeset for help on using the changeset viewer.