source: installer/lib/wrapper/macosx/wrapper.c.diff @ d6c3ffd

Last change on this file since d6c3ffd was d6c3ffd, checked in by zzz <zzz@…>, 15 years ago

2005-09-17 jrandom

  • Added the natively compiled jbigi and patched java service wrapper for OS X. Thanks Bill Dorsey for letting me use your machine!
  • Don't build i2p.exe or i2pinstall.exe when run on OS X machines, as we don't bundle the binutils necessary (and there'd be a naming conflict if we did).
  • Added 'single user' functionality to syndie - if the single user checkbox on the admin page is checked, all users are allowed to control the instance and sync up with remote syndie nodes.
  • Temporarily disable the x-i2p-gzip in i2ptunnel until it is more closely debugged.
  • Property mode set to 100644
File size: 1.9 KB
  • src/c/wrapper.c

    old new  
    312312#include <stdio.h>
    313313#include <stdlib.h>
    314314#include <time.h>
     315
     316#ifdef MACOSX
     317#include <sys/time.h>
     318#else
    315319#include <sys/timeb.h>
     320#endif
     321
    316322#include <sys/stat.h>
    317323#include "wrapperinfo.h"
    318324#include "wrapper.h"
     
    760766    int len;
    761767    int pos;
    762768    int err;
     769
     770    #ifdef MACOSX
     771    struct timeval timeBuffer;
     772    #else
    763773    struct timeb timeBuffer;
     774    #endif
     775
    764776    long startTime;
    765777    int startTimeMillis;
    766778    long now;
    767779    int nowMillis;
    768780    long durr;
    769781   
     782#ifdef MACOSX
     783    gettimeofday(&timeBuffer, NULL);
     784    startTime = now = timeBuffer.tv_sec;
     785    startTimeMillis = nowMillis = timeBuffer.tv_usec / 1000;
     786#else
    770787    ftime( &timeBuffer );
    771788    startTime = now = timeBuffer.time;
    772789    startTimeMillis = nowMillis = timeBuffer.millitm;
     790#endif
    773791
    774792    /*
    775793    log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, "now=%ld, nowMillis=%d", now, nowMillis);
     
    900918        }
    901919
    902920        /* Get the time again */
     921#ifdef MACOSX
     922        gettimeofday(&timeBuffer, NULL);
     923        now = timeBuffer.tv_sec;
     924        nowMillis = timeBuffer.tv_usec / 1000;
     925#else
    903926        ftime( &timeBuffer );
    904927        now = timeBuffer.time;
    905928        nowMillis = timeBuffer.millitm;
     929#endif
    906930    }
    907931    /*
    908932    log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, "done durr=%ld", durr);
     
    22502274 * Calculates a tick count using the system time.
    22512275 */
    22522276DWORD wrapperGetSystemTicks() {
     2277#ifdef MACOSX
     2278    struct timeval timeBuffer;
     2279    gettimeofday(&timeBuffer, NULL);
     2280    return (timeBuffer.tv_sec * 1000 + timeBuffer.tv_usec/1000) / WRAPPER_TICK_MS;
     2281#else
    22532282    struct timeb timeBuffer;
    2254 
    22552283    ftime( &timeBuffer );
    22562284    return (timeBuffer.time * 1000 + timeBuffer.millitm) / WRAPPER_TICK_MS;
     2285#endif
    22572286}
    22582287
    22592288/**
Note: See TracBrowser for help on using the repository browser.