[前][次][番号順一覧][スレッド一覧]

ruby-changes:27209

From: akr <ko1@a...>
Date: Sat, 16 Feb 2013 07:59:13 +0900 (JST)
Subject: [ruby-changes:27209] akr:r39261 (trunk): preprocessor directives indented.

akr	2013-02-16 07:53:59 +0900 (Sat, 16 Feb 2013)

  New Revision: 39261

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39261

  Log:
    preprocessor directives indented.

  Modified files:
    trunk/ext/socket/rubysocket.h

Index: ext/socket/rubysocket.h
===================================================================
--- ext/socket/rubysocket.h	(revision 39260)
+++ ext/socket/rubysocket.h	(revision 39261)
@@ -11,79 +11,81 @@ https://github.com/ruby/ruby/blob/trunk/ext/socket/rubysocket.h#L11
 #include <sys/stat.h>
 
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#  include <unistd.h>
 #endif
 
 #ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
+#  include <sys/uio.h>
 #endif
 
 #ifdef HAVE_XTI_H
-#include <xti.h>
+#  include <xti.h>
 #endif
 
 #ifndef _WIN32
-#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
-# include <net/socket.h>
-#else
-# include <sys/socket.h>
-#endif
-#include <netinet/in.h>
-#ifdef HAVE_NETINET_IN_SYSTM_H
-# include <netinet/in_systm.h>
-#endif
-#ifdef HAVE_NETINET_TCP_H
-# include <netinet/tcp.h>
-#endif
-#ifdef HAVE_NETINET_UDP_H
-# include <netinet/udp.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#include <netdb.h>
+#  if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
+#    include <net/socket.h>
+#  else
+#    include <sys/socket.h>
+#  endif
+#  include <netinet/in.h>
+#  ifdef HAVE_NETINET_IN_SYSTM_H
+#    include <netinet/in_systm.h>
+#  endif
+#  ifdef HAVE_NETINET_TCP_H
+#    include <netinet/tcp.h>
+#  endif
+#  ifdef HAVE_NETINET_UDP_H
+#    include <netinet/udp.h>
+#  endif
+#  ifdef HAVE_ARPA_INET_H
+#    include <arpa/inet.h>
+#  endif
+#  include <netdb.h>
 #endif
+
 #include <errno.h>
+
 #ifdef HAVE_SYS_UN_H
-#include <sys/un.h>
+#  include <sys/un.h>
 #endif
 
 #if defined(HAVE_FCNTL)
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
+#  ifdef HAVE_SYS_SELECT_H
+#    include <sys/select.h>
+#  endif
+#  ifdef HAVE_SYS_TYPES_H
+#    include <sys/types.h>
+#  endif
+#  ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  endif
+#  ifdef HAVE_FCNTL_H
+#    include <fcntl.h>
+#  endif
 #endif
 
 #ifdef HAVE_IFADDRS_H
-#include <ifaddrs.h>
+#  include <ifaddrs.h>
 #endif
 #ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
+#  include <sys/ioctl.h>
 #endif
 #ifdef HAVE_SYS_SOCKIO_H
-#include <sys/sockio.h>
+#  include <sys/sockio.h>
 #endif
 #ifdef HAVE_NET_IF_H
-#include <net/if.h>
+#  include <net/if.h>
 #endif
 
 #ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
+#  include <sys/param.h>
 #endif
 #ifdef HAVE_SYS_UCRED_H
-#include <sys/ucred.h>
+#  include <sys/ucred.h>
 #endif
 #ifdef HAVE_UCRED_H
-#include <ucred.h>
+#  include <ucred.h>
 #endif
 
 #ifndef HAVE_TYPE_SOCKLEN_T
@@ -91,7 +93,7 @@ typedef int socklen_t; https://github.com/ruby/ruby/blob/trunk/ext/socket/rubysocket.h#L93
 #endif
 
 #ifndef EWOULDBLOCK
-#define EWOULDBLOCK EAGAIN
+#  define EWOULDBLOCK EAGAIN
 #endif
 
 /*
@@ -104,44 +106,45 @@ typedef int socklen_t; https://github.com/ruby/ruby/blob/trunk/ext/socket/rubysocket.h#L106
 #define pseudo_AF_FTIP pseudo_AF_RTIP
 
 #ifndef HAVE_GETADDRINFO
-#include "addrinfo.h"
+#  include "addrinfo.h"
 #endif
+
 #include "sockport.h"
 
 #ifndef NI_MAXHOST
-# define NI_MAXHOST 1025
+#  define NI_MAXHOST 1025
 #endif
 #ifndef NI_MAXSERV
-# define NI_MAXSERV 32
+#  define NI_MAXSERV 32
 #endif
 
 #ifdef AF_INET6
-# define IS_IP_FAMILY(af) ((af) == AF_INET || (af) == AF_INET6)
+#  define IS_IP_FAMILY(af) ((af) == AF_INET || (af) == AF_INET6)
 #else
-# define IS_IP_FAMILY(af) ((af) == AF_INET)
+#  define IS_IP_FAMILY(af) ((af) == AF_INET)
 #endif
 
 #ifndef IN6_IS_ADDR_UNIQUE_LOCAL
-# define IN6_IS_ADDR_UNIQUE_LOCAL(a) (((a)->s6_addr[0] == 0xfc) || ((a)->s6_addr[0] == 0xfd))
+#  define IN6_IS_ADDR_UNIQUE_LOCAL(a) (((a)->s6_addr[0] == 0xfc) || ((a)->s6_addr[0] == 0xfd))
 #endif
 
 #ifndef HAVE_TYPE_STRUCT_SOCKADDR_STORAGE
 /*
  * RFC 2553: protocol-independent placeholder for socket addresses
  */
-#define _SS_MAXSIZE     128
-#define _SS_ALIGNSIZE   (sizeof(double))
-#define _SS_PAD1SIZE    (_SS_ALIGNSIZE - sizeof(unsigned char) * 2)
-#define _SS_PAD2SIZE    (_SS_MAXSIZE - sizeof(unsigned char) * 2 - \
+#  define _SS_MAXSIZE     128
+#  define _SS_ALIGNSIZE   (sizeof(double))
+#  define _SS_PAD1SIZE    (_SS_ALIGNSIZE - sizeof(unsigned char) * 2)
+#  define _SS_PAD2SIZE    (_SS_MAXSIZE - sizeof(unsigned char) * 2 - \
                                 _SS_PAD1SIZE - _SS_ALIGNSIZE)
 
 struct sockaddr_storage {
-#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
+#  ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
         unsigned char ss_len;           /* address length */
         unsigned char ss_family;        /* address family */
-#else
+#  else
         unsigned short ss_family;
-#endif
+#  endif
         char    __ss_pad1[_SS_PAD1SIZE];
         double  __ss_align;     /* force desired structure storage alignment */
         char    __ss_pad2[_SS_PAD2SIZE];
@@ -154,22 +157,22 @@ struct sockaddr_storage { https://github.com/ruby/ruby/blob/trunk/ext/socket/rubysocket.h#L157
  * aligns up to __darwin_size_t which is 64bit, but CMSG_DATA is
  * 32bit-aligned.
  */
-#undef __DARWIN_ALIGNBYTES
-#define __DARWIN_ALIGNBYTES (sizeof(unsigned int) - 1)
+#  undef __DARWIN_ALIGNBYTES
+#  define __DARWIN_ALIGNBYTES (sizeof(unsigned int) - 1)
 #endif
 
 #if defined(_AIX)
-#ifndef CMSG_SPACE
-# define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
-#endif
-#ifndef CMSG_LEN
-# define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
-#endif
+#  ifndef CMSG_SPACE
+#    define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
+#  endif
+#  ifndef CMSG_LEN
+#    define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+#  endif
 #endif
 
 #ifdef __BEOS__
-#undef close
-#define close closesocket
+#  undef close
+#  define close closesocket
 #endif
 
 #define INET_CLIENT 0
@@ -196,12 +199,12 @@ extern VALUE rb_eSocket; https://github.com/ruby/ruby/blob/trunk/ext/socket/rubysocket.h#L199
 
 #ifdef SOCKS
 extern VALUE rb_cSOCKSSocket;
-#ifdef SOCKS5
-#include <socks.h>
-#else
+#  ifdef SOCKS5
+#    include <socks.h>
+#  else
 void SOCKSinit();
 int Rconnect();
-#endif
+#  endif
 #endif
 
 #include "constdefs.h"
@@ -289,6 +292,7 @@ VALUE rsock_bsock_sendmsg_nonblock(int a https://github.com/ruby/ruby/blob/trunk/ext/socket/rubysocket.h#L292
 #define rsock_bsock_sendmsg rb_f_notimplement
 #define rsock_bsock_sendmsg_nonblock rb_f_notimplement
 #endif
+
 #if defined(HAVE_RECVMSG)
 VALUE rsock_bsock_recvmsg(int argc, VALUE *argv, VALUE sock);
 VALUE rsock_bsock_recvmsg_nonblock(int argc, VALUE *argv, VALUE sock);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]