Changeset 46fd4a


Ignore:
Timestamp:
10/05/08 13:41:32 (4 years ago)
Author:
Tomash Brechko <tomash.brechko@…>
Branches:
master
Children:
c346b2
Parents:
11df21
git-author:
Tomash Brechko <tomash.brechko@…> (09/29/08 10:31:01)
git-committer:
Tomash Brechko <tomash.brechko@…> (10/05/08 13:41:32)
Message:

Add Win32 support.

Thanks to Yasuhiro Matsumoto for initial patch.

Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • Changes

    r6fee7e r46fd4a  
    22 
    330.13  ??? 
    4         - ??? 
     4        - introduce Win32 support (based on the patch by Yasuhiro 
     5          Matsumoto---arigatou!). 
    56 
    67        Changes since 0.12: 
    78 
    8         ??? 
     9        Add support for Win32.  I personally don't have the system nor 
     10        compiler, so I can't even test the build.  Win32 port is 
     11        expected to be supported by community. 
    912 
    1013 
  • MANIFEST

    r11df21 r46fd4a  
    3636src/socket_posix.c 
    3737src/socket_posix.h 
     38src/socket_win32.c 
     39src/socket_win32.h 
  • README

    r6fee7e r46fd4a  
    1919API and may be used by itself). 
    2020 
    21 The module should compile and work on any Unix-derived system. 
    22 According to CPAN testers it doesn't compile on Windows, patches are 
    23 welcome. 
     21The module should compile and work on any Unix-derived system.  Win32 
     22support is based on the patch by Yasuhiro Matsumoto---thanks!, and is 
     23(expected to be) supported by community. 
    2424 
    2525Despite the low version number (which mainly reflects release history) 
  • lib/Cache/Memcached/Fast.pm

    r6fee7e r46fd4a  
    13821382Thanks to S<Peter J. Holzer> for enlightening on UTF-8 support. 
    13831383 
     1384Thanks to S<Yasuhiro Matsumoto> for initial Win32 patch. 
     1385 
    13841386 
    13851387=head1 WARRANTY 
  • src/Makefile.PL

    r182fc0 r46fd4a  
    33use warnings; 
    44use ExtUtils::MakeMaker; 
     5 
     6 
     7my @c = ('parse_keyword.c', 'compute_crc32.c', <*.c>); 
     8my $exclude; 
     9if ($^O eq 'MSWin32') { 
     10    $exclude = 'socket_posix.c'; 
     11} else { 
     12    $exclude = 'socket_win32.c'; 
     13} 
     14 
     15my @object = grep { $_ ne $exclude } @c; 
     16map { s/\.c$/\$(OBJ_EXT)/ } @object; 
     17 
    518 
    619# See lib/ExtUtils/MakeMaker.pm for details of how to influence 
     
    1326    DEFINE            => '', # e.g., '-DHAVE_SOMETHING' 
    1427    INC               => '-I.', # e.g., '-I. -I/usr/include/other' 
    15     OBJECT            => 'parse_keyword$(OBJ_EXT) compute_crc32$(OBJ_EXT) 
    16                           $(O_FILES)', 
     28    OBJECT            => "@object", 
    1729    clean             => { FILES => 'compute_crc32.c compute_crc32.h' 
    1830                               . ' parse_keyword.c parse_keyword.h' }, 
  • src/client.c

    r11df21 r46fd4a  
    3030#include <string.h> 
    3131#include <stdio.h> 
     32#ifndef WIN32 
    3233#include <sys/uio.h> 
    3334#include <signal.h> 
     
    3637#include <netinet/tcp.h> 
    3738#include "socket_posix.h" 
     39#else  /* WIN32 */ 
     40#include "socket_win32.h" 
     41#endif  /* WIN32 */ 
    3842 
    3943 
     
    337341client_init() 
    338342{ 
     343#ifdef WIN32 
     344  if (win32_socket_library_acquire() != 0) 
     345    return NULL; 
     346#endif  /* WIN32 */ 
     347 
    339348  struct client *c = malloc(sizeof(struct client)); 
    340349  if (! c) 
     
    391400    free(c->prefix); 
    392401  free(c); 
     402 
     403#ifdef WIN32 
     404  win32_socket_library_release(); 
     405#endif  /* WIN32 */ 
    393406} 
    394407 
     
    13711384  int first_iter = 1; 
    13721385 
    1373 #ifndef MSG_NOSIGNAL 
     1386#if ! defined(MSG_NOSIGNAL) && ! defined(WIN32) 
    13741387  struct sigaction orig, ignore; 
    13751388  int res; 
     
    13811394  if (res == -1) 
    13821395    return MEMCACHED_FAILURE; 
    1383 #endif /* ! MSG_NOSIGNAL */ 
     1396#endif /* ! defined(MSG_NOSIGNAL) && ! defined(WIN32) */ 
    13841397 
    13851398  while (1) 
     
    15081521    } 
    15091522 
    1510 #ifndef MSG_NOSIGNAL 
     1523#if ! defined(MSG_NOSIGNAL) && ! defined(WIN32) 
    15111524  /* 
    15121525    Ignore return value of sigaction(), there's nothing we can do in 
     
    15141527  */ 
    15151528  sigaction(SIGPIPE, &orig, NULL); 
    1516 #endif /* ! MSG_NOSIGNAL */ 
     1529#endif /* ! defined(MSG_NOSIGNAL) && ! defined(WIN32) */ 
    15171530 
    15181531  return MEMCACHED_SUCCESS; 
  • src/connect.c

    r11df21 r46fd4a  
    2424#include "connect.h" 
    2525#include <string.h> 
     26#ifndef WIN32 
    2627#include <netdb.h> 
    2728#include "socket_posix.h" 
     29#else  /* WIN32 */ 
     30#include "socket_win32.h" 
     31#endif  /* WIN32 */ 
    2832 
    2933 
Note: See TracChangeset for help on using the changeset viewer.