Changeset 2808


Ignore:
Timestamp:
Jun 16, 2003, 9:46:22 PM (17 years ago)
Author:
ssen
Message:

Use all the HAVE_FOO_H to conditionalize header inclusion. Don't use
APPLE, instead use HAVE_CRT_EXTERNS_H

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/pextlib1.0/Pextlib.c

    r2611 r2808  
    3030 */
    3131
     32#if HAVE_CONFIG_H
     33#include <config.h>
     34#endif
     35
    3236#include <stdio.h>
    3337#include <stdlib.h>
     
    3539#include <errno.h>
    3640#include <grp.h>
     41
     42#if HAVE_STRING_H
    3743#include <string.h>
     44#endif
     45
     46#if HAVE_DIRENT_H
    3847#include <dirent.h>
     48#endif
     49
     50#if HAVE_LIMITS_H
    3951#include <limits.h>
     52#endif
     53
     54#if HAVE_PATHS_H
    4055#include <paths.h>
     56#else
     57#ifndef _PATH_DEVNULL
     58#define _PATH_DEVNULL "/dev/null"
     59#endif
     60#endif
     61
    4162#include <pwd.h>
     63
     64#if HAVE_SYS_FILE_H
    4265#include <sys/file.h>
     66#endif
     67
     68#if HAVE_SYS_TYPES_H
    4369#include <sys/types.h>
     70#endif
     71
     72#if HAVE_SYS_WAIT_H
    4473#include <sys/wait.h>
     74#endif
     75
     76#if HAVE_UNISTD_H
     77#include <unistd.h>
     78#endif
     79
    4580#include <tcl.h>
    46 #include <unistd.h>
    47 #ifdef __APPLE__
     81
     82#if HAVE_CRT_EXTERNS_H
    4883#include <crt_externs.h>
     84#define environ (*_NSGetEnviron())
     85#else
     86extern char **environ;
     87#endif
     88
     89#if !HAVE_BZERO
     90#if HAVE_MEMSET
     91#define bzero(b, len) (void)memset(b, 0x00, len)
     92#endif
    4993#endif
    5094
    5195#define CBUFSIZ 30
    52 
    53 #if !defined(__APPLE__)
    54 extern char **environ;
    55 #endif
    5696
    5797char *ui_escape(const char *source)
     
    138178        Tcl_Obj *errbuf;
    139179        Tcl_Obj *tcl_result;
    140 
    141 #if defined(__APPLE__)
    142         char **environ;
    143         environ = *_NSGetEnviron();
    144 #endif
    145180
    146181        if (objc != 2) {
     
    444479        channel = Tcl_MakeFileChannel((ClientData) fd, TCL_READABLE|TCL_WRITABLE);
    445480        Tcl_RegisterChannel(interp, channel);
    446         channelname = Tcl_GetChannelName(channel);
     481        channelname = (char *)Tcl_GetChannelName(channel);
    447482        Tcl_AppendResult(interp, channelname, " ", template, NULL);
    448483        free(template);
Note: See TracChangeset for help on using the changeset viewer.