*** ./ext/mysqlnd/mysqlnd_result.c.ORIG	Sun Aug 21 22:01:56 2011
--- ./ext/mysqlnd/mysqlnd_result.c	Sun Aug 21 22:06:54 2011
***************
*** 31,36 ****
--- 31,43 ----
  
  #define MYSQLND_SILENT
  
+ #if defined(_AIX51) && !defined(_AIX52)
+ #if (__64BIT__)
+ #define SIZE_MAX        UINT64_MAX
+ #else
+ #define SIZE_MAX        UINT32_MAX
+ #endif
+ #endif
  
  /* {{{ mysqlnd_res::initialize_result_set_rest */
  static enum_func_status
*** ./ext/sockets/sockets.c.ORIG	Tue Jun  5 21:51:24 2012
--- ./ext/sockets/sockets.c	Tue Jun  5 21:51:44 2012
***************
*** 84,89 ****
--- 84,93 ----
  
  #include "multicast.h"
  
+ #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61))
+ #define ss_family __ss_family
+ #endif
+ 
  ZEND_DECLARE_MODULE_GLOBALS(sockets)
  static PHP_GINIT_FUNCTION(sockets);
  
*** ./ext/standard/string.c.ORIG	Mon Feb 25 13:53:31 2013
--- ./ext/standard/string.c	Mon Feb 25 13:54:22 2013
***************
*** 26,32 ****
  #ifdef PHP_WIN32
  # include "win32/php_stdint.h"
  #else
! # include <stdint.h>
  #endif
  #include "php.h"
  #include "php_rand.h"
--- 26,36 ----
  #ifdef PHP_WIN32
  # include "win32/php_stdint.h"
  #else
! # if defined(_AIX51) && !defined(_AIX52)
! #  include <inttypes.h>
! # else
! #  include <stdint.h>
! # endif
  #endif
  #include "php.h"
  #include "php_rand.h"
*** ./ext/sockets/sockaddr_conv.c.ORIG	Mon Jun 24 16:27:47 2013
--- ./ext/sockets/sockaddr_conv.c	Mon Jun 24 16:28:25 2013
***************
*** 87,92 ****
--- 87,96 ----
  }
  /* }}} */
  
+ #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61))
+ #define ss_family __ss_family
+ #endif
+ 
  /* Sets addr by hostname or by ip in string form (AF_INET or AF_INET6,
   * depending on the socket) */
  int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock TSRMLS_DC) /* {{{ */
*** ./ext/mysqlnd/mysqlnd_wireprotocol.c.ORIG	Mon Jun 24 18:05:14 2013
--- ./ext/mysqlnd/mysqlnd_wireprotocol.c	Mon Jun 24 18:09:01 2013
***************
*** 125,130 ****
--- 125,135 ----
  };
  
  
+ #ifdef _AIX51
+ #define atoll(X) strtoll(X, (char **)NULL, 10)
+ #endif
+ 
+ 
  /* {{{ php_mysqlnd_net_field_length
     Get next field's length */
  unsigned long
*** ./ext/date/php_date.c.ORIG	Mon Jun 24 17:58:52 2013
--- ./ext/date/php_date.c	Mon Jun 24 18:08:35 2013
***************
*** 39,44 ****
--- 39,48 ----
  static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; }
  #endif
  
+ #ifdef _AIX51
+ #define atoll(X) strtoll(X, (char **)NULL, 10)
+ #endif
+ 
  #ifdef PHP_WIN32
  #define DATE_I64_BUF_LEN 65
  # define DATE_I64A(i, s, len) _i64toa_s(i, s, len, 10)
*** ./ext/sockets/conversions.c.ORIG	Mon Jun 24 18:00:39 2013
--- ./ext/sockets/conversions.c	Mon Jun 24 20:02:33 2013
***************
*** 24,29 ****
--- 24,38 ----
  #include <stdarg.h>
  #include <stddef.h>
  
+ 
+ #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
+ 
+ 
  #ifdef PHP_WIN32
  typedef unsigned short sa_family_t;
  # define msghdr			_WSAMSG
*** ./ext/sockets/sendrecvmsg.c.ORIG	Mon Jun 24 18:02:36 2013
--- ./ext/sockets/sendrecvmsg.c	Mon Jun 24 20:03:01 2013
***************
*** 30,35 ****
--- 30,41 ----
  #define DEFAULT_BUFF_SIZE 8192
  #define MAX_ARRAY_KEY_SIZE 128
  
+ 
+ #ifndef CMSG_SPACE
+ #define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
+ #endif
+ 
+ 
  #ifdef PHP_WIN32
  #include "windows_common.h"
  #include <Mswsock.h>
