Changeset 13368 in project for chicken


Ignore:
Timestamp:
02/20/09 03:12:21 (11 years ago)
Author:
Jim Ursetto
Message:

posixunix: unsetenv didn't work on OS X

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/posixunix.scm

    r13167 r13368  
    196196#define C_sleep             sleep
    197197
    198 #define C_putenv(s)         C_fix(putenv((char *)C_data_pointer(s)))
    199198#define C_stat(fn)          C_fix(stat((char *)C_data_pointer(fn), &C_statbuf))
    200199#define C_lstat(fn)         C_fix(lstat((char *)C_data_pointer(fn), &C_statbuf))
     
    214213
    215214#ifdef C_GNU_ENV
     215# define C_unsetenv(s)      (unsetenv((char *)C_data_pointer(s)), C_SCHEME_TRUE)
    216216# define C_setenv(x, y)     C_fix(setenv((char *)C_data_pointer(x), (char *)C_data_pointer(y), 1))
    217217#else
     218# define C_unsetenv(s)      C_fix(putenv((char *)C_data_pointer(s)))
    218219static C_word C_fcall C_setenv(C_word x, C_word y) {
    219220  char *sx = C_data_pointer(x),
     
    18731874(define (unsetenv var)
    18741875  (##sys#check-string var 'unsetenv)
    1875   (##core#inline "C_putenv" (##sys#make-c-string var))
     1876  (##core#inline "C_unsetenv" (##sys#make-c-string var))
    18761877  (##core#undefined) )
    18771878
Note: See TracChangeset for help on using the changeset viewer.