Changeset 34

Show
Ignore:
Timestamp:
09/22/07 18:53:20 (7 years ago)
Author:
jesus
Message:

pull the macros into the header

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tags/2007080101/fastxsl.c

    r33 r34  
    344344        } 
    345345} 
    346 #endif 
    347  
    348 #ifdef F_SETLK 
    349 #define ACQUIRE(lockfd) do { \ 
    350         struct flock lock; \ 
    351         lock.l_start = 0; \ 
    352         lock.l_whence = SEEK_SET; \ 
    353         lock.l_len = 0; \ 
    354         lock.l_type = F_WRLCK; \ 
    355         fcntl((lockfd), F_SETLKW, &lock); \ 
    356 } while(0) 
    357 #define RELEASE(lockfd) do { \ 
    358         struct flock lock; \ 
    359         lock.l_start = 0; \ 
    360         lock.l_whence = SEEK_SET; \ 
    361         lock.l_len = 0; \ 
    362         lock.l_type = F_UNLCK; \ 
    363         fcntl((lockfd), F_SETLK, &lock); \ 
    364 } while(0) 
    365 #else 
    366 #define ACQUIRE(lockfd) flock((lockfd), LOCK_EX) 
    367 #define RELEASE(lockfd) flock((lockfd), LOCK_UN) 
    368346#endif 
    369347 
  • tags/2007080101/php_fastxsl.h

    r26 r34  
    111111} zend_fastxsl_globals; 
    112112 
     113#ifdef F_SETLK 
     114#define ACQUIRE(lockfd) do { \ 
     115        struct flock lock; \ 
     116        lock.l_start = 0; \ 
     117        lock.l_whence = SEEK_SET; \ 
     118        lock.l_len = 0; \ 
     119        lock.l_type = F_WRLCK; \ 
     120        fcntl((lockfd), F_SETLKW, &lock); \ 
     121} while(0) 
     122#define RELEASE(lockfd) do { \ 
     123        struct flock lock; \ 
     124        lock.l_start = 0; \ 
     125        lock.l_whence = SEEK_SET; \ 
     126        lock.l_len = 0; \ 
     127        lock.l_type = F_UNLCK; \ 
     128        fcntl((lockfd), F_SETLK, &lock); \ 
     129} while(0) 
     130#else 
     131#define ACQUIRE(lockfd) flock((lockfd), LOCK_EX) 
     132#define RELEASE(lockfd) flock((lockfd), LOCK_UN) 
     133#endif 
     134 
    113135#define PHP_FASTXSL_VERSION "1.0" 
    114136