New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 79546


Ignore:
Timestamp:
06/17/11 11:53:16 (4 years ago)
Author:
cal@…
Message:

rev-upgrade: Moved fileIsBinary to conditional MACH section, added static keyword and comment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Pextlib.c

    r79539 r79546  
    5555#include <unistd.h> 
    5656 
    57 /* 
    58   people use this on non-mac systems 
    59   #include <mach-o/loader.h> 
    60   #include <mach-o/fat.h> 
    61 */ 
    62 #define MH_MAGIC    (0xfeedface) 
    63 #define MH_MAGIC_64 (0xfeedfacf) 
    64 #define FAT_MAGIC   (0xcafebabe) 
     57#ifdef __MACH__ 
     58#include <mach-o/loader.h> 
     59#include <mach-o/fat.h> 
     60#endif 
    6561 
    6662#include <tcl.h> 
     
    474470} 
    475471 
    476 int fileIsBinaryCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 
     472#ifdef __MACH__ 
     473/** 
     474 * Tcl function to determine whether a file given by path is binary (in terms of being Mach-O) 
     475 * Defined on Mac-Systems only, because the necessary headers are only available there. 
     476 * 
     477 * Synopsis: fileIsBinary filename 
     478 */ 
     479static int fileIsBinaryCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 
    477480    const char *path; 
    478481    FILE *file; 
     
    562565    return TCL_OK; 
    563566} 
    564  
     567#endif 
    565568 
    566569int Pextlib_Init(Tcl_Interp *interp) 
     
    596599    Tcl_CreateObjCommand(interp, "unsetenv", UnsetEnvCmd, NULL, NULL); 
    597600    Tcl_CreateObjCommand(interp, "lchown", lchownCmd, NULL, NULL); 
     601    Tcl_CreateObjCommand(interp, "realpath", RealpathCmd, NULL, NULL); 
     602#ifdef __MACH__ 
    598603    Tcl_CreateObjCommand(interp, "fileIsBinary", fileIsBinaryCmd, NULL, NULL); 
    599     Tcl_CreateObjCommand(interp, "realpath", RealpathCmd, NULL, NULL); 
     604#endif 
    600605 
    601606    Tcl_CreateObjCommand(interp, "readline", ReadlineCmd, NULL, NULL); 
Note: See TracChangeset for help on using the changeset viewer.