You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ben Craig (JIRA)" <ji...@apache.org> on 2012/11/12 20:47:12 UTC

[jira] [Created] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Ben Craig created THRIFT-1753:
---------------------------------

             Summary: Multiple C++ Windows, OSX, and iOS portability issues
                 Key: THRIFT-1753
                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
             Project: Thrift
          Issue Type: Bug
          Components: C++ - Library
    Affects Versions: 0.9, 1.0
         Environment: Windows MSVC10, MSVC11
OSX GCC-4.2
iOS Clang-4.0
            Reporter: Ben Craig
             Fix For: 1.0


These are all in the C++ library.  Here is a summary of what I changed. 
All of these fixes make a ~5000 line patch (though a lot of that is 
deleted lines).
*   General cleanup of the msvc project
*   Using HAVE_CONFIG_H instead of force including files
*   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
*   Significant rework of windows portability.  No longer using config.h 
and force_inc.h to make Windows look like *nix.  Instead, making lots of 
Thrift specific #defines that are vaguely *nixy, and having those forward 
to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
approach doesn't work when multiple libraries attempt the same trick.  For 
example, if openssl #defined errno to ::WSAGetLastError() as well, then 
that would cause problems.
*   Adding preprocessor flag that can optionally squelch console output. 
Default behavior is unchanged.  Console output is great for home deployed 
server apps, but it looks unprofessional for consumer apps.
*   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
warnings.
*   Adding redirector header for <functional> and <tr1/functional>.  Since 
namespaces aren't consistent (std vs std::tr1), I have added symbols to 
the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
support
*   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
now correctly sleeps for seconds, and usleep attempts to sleep for 
microseconds (after converting very coarsely to milliseconds).
*   Adding support for using C++11 std::thread (and mutex, and monitor). 
Thrift already supported boost::thread and posix threads.  Clients that 
use std::thread no longer need built boost libraries.  The boost headers 
are sufficient for them.  Switching from boost::thread to std::thread 
resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
and below will use boost::thread, msvc11 and up will use std::thread.
*   Fixing more 64-bit socket truncation issues in non-blocking server and 
ssl support.  openssl itself has socket truncation issues, so I could not 
fix them all.
*   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
*   Making TFileTransport use thrift style threads instead of redoing all 
the pthread+boost stuff itself.
*   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
and iOS)
*   Moved several functions out of thrift/windows/config.h, and into other 
thrift/windows headers.
*   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Posted by "Ben Craig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Craig updated THRIFT-1753:
------------------------------

    Attachment:     (was: cleaner_port.patch)
    
> Multiple C++ Windows, OSX, and iOS portability issues
> -----------------------------------------------------
>
>                 Key: THRIFT-1753
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9, 1.0
>         Environment: Windows MSVC10, MSVC11
> OSX GCC-4.2
> iOS Clang-4.0
>            Reporter: Ben Craig
>             Fix For: 1.0
>
>         Attachments: cleaner_port2.patch
>
>
> These are all in the C++ library.  Here is a summary of what I changed. 
> All of these fixes make a ~5000 line patch (though a lot of that is 
> deleted lines).
> *   General cleanup of the msvc project
> *   Using HAVE_CONFIG_H instead of force including files
> *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
> *   Significant rework of windows portability.  No longer using config.h 
> and force_inc.h to make Windows look like *nix.  Instead, making lots of 
> Thrift specific #defines that are vaguely *nixy, and having those forward 
> to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
> ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
> approach doesn't work when multiple libraries attempt the same trick.  For 
> example, if openssl #defined errno to ::WSAGetLastError() as well, then 
> that would cause problems.
> *   Adding preprocessor flag that can optionally squelch console output. 
> Default behavior is unchanged.  Console output is great for home deployed 
> server apps, but it looks unprofessional for consumer apps.
> *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
> warnings.
> *   Adding redirector header for <functional> and <tr1/functional>.  Since 
> namespaces aren't consistent (std vs std::tr1), I have added symbols to 
> the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
> support
> *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
> now correctly sleeps for seconds, and usleep attempts to sleep for 
> microseconds (after converting very coarsely to milliseconds).
> *   Adding support for using C++11 std::thread (and mutex, and monitor). 
> Thrift already supported boost::thread and posix threads.  Clients that 
> use std::thread no longer need built boost libraries.  The boost headers 
> are sufficient for them.  Switching from boost::thread to std::thread 
> resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
> and below will use boost::thread, msvc11 and up will use std::thread.
> *   Fixing more 64-bit socket truncation issues in non-blocking server and 
> ssl support.  openssl itself has socket truncation issues, so I could not 
> fix them all.
> *   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
> ".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
> *   Making TFileTransport use thrift style threads instead of redoing all 
> the pthread+boost stuff itself.
> *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
> and iOS)
> *   Moved several functions out of thrift/windows/config.h, and into other 
> thrift/windows headers.
> *   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
> using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Posted by "Ben Craig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13504964#comment-13504964 ] 

Ben Craig commented on THRIFT-1753:
-----------------------------------

So... hung in TransportTest somewhere?  I'll see what I can come up with.

I guess this is further encouragement to get the test suite running on Windows as well.
                
> Multiple C++ Windows, OSX, and iOS portability issues
> -----------------------------------------------------
>
>                 Key: THRIFT-1753
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9, 1.0
>         Environment: Windows MSVC10, MSVC11
> OSX GCC-4.2
> iOS Clang-4.0
>            Reporter: Ben Craig
>             Fix For: 1.0
>
>         Attachments: cleaner_port3.patch
>
>
> These are all in the C++ library.  Here is a summary of what I changed. 
> All of these fixes make a ~5000 line patch (though a lot of that is 
> deleted lines).
> *   General cleanup of the msvc project
> *   Using HAVE_CONFIG_H instead of force including files
> *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
> *   Significant rework of windows portability.  No longer using config.h 
> and force_inc.h to make Windows look like *nix.  Instead, making lots of 
> Thrift specific #defines that are vaguely *nixy, and having those forward 
> to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
> ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
> approach doesn't work when multiple libraries attempt the same trick.  For 
> example, if openssl #defined errno to ::WSAGetLastError() as well, then 
> that would cause problems.
> *   Adding preprocessor flag that can optionally squelch console output. 
> Default behavior is unchanged.  Console output is great for home deployed 
> server apps, but it looks unprofessional for consumer apps.
> *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
> warnings.
> *   Adding redirector header for <functional> and <tr1/functional>.  Since 
> namespaces aren't consistent (std vs std::tr1), I have added symbols to 
> the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
> support
> *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
> now correctly sleeps for seconds, and usleep attempts to sleep for 
> microseconds (after converting very coarsely to milliseconds).
> *   Adding support for using C++11 std::thread (and mutex, and monitor). 
> Thrift already supported boost::thread and posix threads.  Clients that 
> use std::thread no longer need built boost libraries.  The boost headers 
> are sufficient for them.  Switching from boost::thread to std::thread 
> resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
> and below will use boost::thread, msvc11 and up will use std::thread.
> *   Fixing more 64-bit socket truncation issues in non-blocking server and 
> ssl support.  openssl itself has socket truncation issues, so I could not 
> fix them all.
> *   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
> ".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
> *   Making TFileTransport use thrift style threads instead of redoing all 
> the pthread+boost stuff itself.
> *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
> and iOS)
> *   Moved several functions out of thrift/windows/config.h, and into other 
> thrift/windows headers.
> *   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
> using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Posted by "Ben Craig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Craig updated THRIFT-1753:
------------------------------

    Attachment: cleaner_port2.patch

Does not yet address THRIFT-990.  Still contains THRIFT_UNUSED_VARIABLE.
                
> Multiple C++ Windows, OSX, and iOS portability issues
> -----------------------------------------------------
>
>                 Key: THRIFT-1753
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9, 1.0
>         Environment: Windows MSVC10, MSVC11
> OSX GCC-4.2
> iOS Clang-4.0
>            Reporter: Ben Craig
>             Fix For: 1.0
>
>         Attachments: cleaner_port2.patch
>
>
> These are all in the C++ library.  Here is a summary of what I changed. 
> All of these fixes make a ~5000 line patch (though a lot of that is 
> deleted lines).
> *   General cleanup of the msvc project
> *   Using HAVE_CONFIG_H instead of force including files
> *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
> *   Significant rework of windows portability.  No longer using config.h 
> and force_inc.h to make Windows look like *nix.  Instead, making lots of 
> Thrift specific #defines that are vaguely *nixy, and having those forward 
> to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
> ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
> approach doesn't work when multiple libraries attempt the same trick.  For 
> example, if openssl #defined errno to ::WSAGetLastError() as well, then 
> that would cause problems.
> *   Adding preprocessor flag that can optionally squelch console output. 
> Default behavior is unchanged.  Console output is great for home deployed 
> server apps, but it looks unprofessional for consumer apps.
> *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
> warnings.
> *   Adding redirector header for <functional> and <tr1/functional>.  Since 
> namespaces aren't consistent (std vs std::tr1), I have added symbols to 
> the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
> support
> *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
> now correctly sleeps for seconds, and usleep attempts to sleep for 
> microseconds (after converting very coarsely to milliseconds).
> *   Adding support for using C++11 std::thread (and mutex, and monitor). 
> Thrift already supported boost::thread and posix threads.  Clients that 
> use std::thread no longer need built boost libraries.  The boost headers 
> are sufficient for them.  Switching from boost::thread to std::thread 
> resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
> and below will use boost::thread, msvc11 and up will use std::thread.
> *   Fixing more 64-bit socket truncation issues in non-blocking server and 
> ssl support.  openssl itself has socket truncation issues, so I could not 
> fix them all.
> *   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
> ".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
> *   Making TFileTransport use thrift style threads instead of redoing all 
> the pthread+boost stuff itself.
> *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
> and iOS)
> *   Moved several functions out of thrift/windows/config.h, and into other 
> thrift/windows headers.
> *   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
> using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Posted by "Ben Craig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Craig updated THRIFT-1753:
------------------------------

    Attachment:     (was: cleaner_port2.patch)
    
> Multiple C++ Windows, OSX, and iOS portability issues
> -----------------------------------------------------
>
>                 Key: THRIFT-1753
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9, 1.0
>         Environment: Windows MSVC10, MSVC11
> OSX GCC-4.2
> iOS Clang-4.0
>            Reporter: Ben Craig
>             Fix For: 1.0
>
>         Attachments: cleaner_port3.patch
>
>
> These are all in the C++ library.  Here is a summary of what I changed. 
> All of these fixes make a ~5000 line patch (though a lot of that is 
> deleted lines).
> *   General cleanup of the msvc project
> *   Using HAVE_CONFIG_H instead of force including files
> *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
> *   Significant rework of windows portability.  No longer using config.h 
> and force_inc.h to make Windows look like *nix.  Instead, making lots of 
> Thrift specific #defines that are vaguely *nixy, and having those forward 
> to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
> ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
> approach doesn't work when multiple libraries attempt the same trick.  For 
> example, if openssl #defined errno to ::WSAGetLastError() as well, then 
> that would cause problems.
> *   Adding preprocessor flag that can optionally squelch console output. 
> Default behavior is unchanged.  Console output is great for home deployed 
> server apps, but it looks unprofessional for consumer apps.
> *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
> warnings.
> *   Adding redirector header for <functional> and <tr1/functional>.  Since 
> namespaces aren't consistent (std vs std::tr1), I have added symbols to 
> the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
> support
> *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
> now correctly sleeps for seconds, and usleep attempts to sleep for 
> microseconds (after converting very coarsely to milliseconds).
> *   Adding support for using C++11 std::thread (and mutex, and monitor). 
> Thrift already supported boost::thread and posix threads.  Clients that 
> use std::thread no longer need built boost libraries.  The boost headers 
> are sufficient for them.  Switching from boost::thread to std::thread 
> resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
> and below will use boost::thread, msvc11 and up will use std::thread.
> *   Fixing more 64-bit socket truncation issues in non-blocking server and 
> ssl support.  openssl itself has socket truncation issues, so I could not 
> fix them all.
> *   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
> ".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
> *   Making TFileTransport use thrift style threads instead of redoing all 
> the pthread+boost stuff itself.
> *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
> and iOS)
> *   Moved several functions out of thrift/windows/config.h, and into other 
> thrift/windows headers.
> *   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
> using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Posted by "Ben Craig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Craig updated THRIFT-1753:
------------------------------

    Attachment: cleaner_port.patch
    
> Multiple C++ Windows, OSX, and iOS portability issues
> -----------------------------------------------------
>
>                 Key: THRIFT-1753
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9, 1.0
>         Environment: Windows MSVC10, MSVC11
> OSX GCC-4.2
> iOS Clang-4.0
>            Reporter: Ben Craig
>             Fix For: 1.0
>
>         Attachments: cleaner_port.patch
>
>
> These are all in the C++ library.  Here is a summary of what I changed. 
> All of these fixes make a ~5000 line patch (though a lot of that is 
> deleted lines).
> *   General cleanup of the msvc project
> *   Using HAVE_CONFIG_H instead of force including files
> *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
> *   Significant rework of windows portability.  No longer using config.h 
> and force_inc.h to make Windows look like *nix.  Instead, making lots of 
> Thrift specific #defines that are vaguely *nixy, and having those forward 
> to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
> ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
> approach doesn't work when multiple libraries attempt the same trick.  For 
> example, if openssl #defined errno to ::WSAGetLastError() as well, then 
> that would cause problems.
> *   Adding preprocessor flag that can optionally squelch console output. 
> Default behavior is unchanged.  Console output is great for home deployed 
> server apps, but it looks unprofessional for consumer apps.
> *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
> warnings.
> *   Adding redirector header for <functional> and <tr1/functional>.  Since 
> namespaces aren't consistent (std vs std::tr1), I have added symbols to 
> the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
> support
> *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
> now correctly sleeps for seconds, and usleep attempts to sleep for 
> microseconds (after converting very coarsely to milliseconds).
> *   Adding support for using C++11 std::thread (and mutex, and monitor). 
> Thrift already supported boost::thread and posix threads.  Clients that 
> use std::thread no longer need built boost libraries.  The boost headers 
> are sufficient for them.  Switching from boost::thread to std::thread 
> resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
> and below will use boost::thread, msvc11 and up will use std::thread.
> *   Fixing more 64-bit socket truncation issues in non-blocking server and 
> ssl support.  openssl itself has socket truncation issues, so I could not 
> fix them all.
> *   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
> ".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
> *   Making TFileTransport use thrift style threads instead of redoing all 
> the pthread+boost stuff itself.
> *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
> and iOS)
> *   Moved several functions out of thrift/windows/config.h, and into other 
> thrift/windows headers.
> *   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
> using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Posted by "Ben Craig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Craig updated THRIFT-1753:
------------------------------

    Attachment: cleaner_port3.patch

Addresses the same issues mentioned above, plus it fixes THRIFT-990 by making everything use gettimeofday.  In addition, very little code should be using timespecs now.  Code dealing directly with POSIX wait functions, and code that clients can use directly still use timespecs, but everything else uses timevals now.
                
> Multiple C++ Windows, OSX, and iOS portability issues
> -----------------------------------------------------
>
>                 Key: THRIFT-1753
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9, 1.0
>         Environment: Windows MSVC10, MSVC11
> OSX GCC-4.2
> iOS Clang-4.0
>            Reporter: Ben Craig
>             Fix For: 1.0
>
>         Attachments: cleaner_port2.patch, cleaner_port3.patch
>
>
> These are all in the C++ library.  Here is a summary of what I changed. 
> All of these fixes make a ~5000 line patch (though a lot of that is 
> deleted lines).
> *   General cleanup of the msvc project
> *   Using HAVE_CONFIG_H instead of force including files
> *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
> *   Significant rework of windows portability.  No longer using config.h 
> and force_inc.h to make Windows look like *nix.  Instead, making lots of 
> Thrift specific #defines that are vaguely *nixy, and having those forward 
> to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
> ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
> approach doesn't work when multiple libraries attempt the same trick.  For 
> example, if openssl #defined errno to ::WSAGetLastError() as well, then 
> that would cause problems.
> *   Adding preprocessor flag that can optionally squelch console output. 
> Default behavior is unchanged.  Console output is great for home deployed 
> server apps, but it looks unprofessional for consumer apps.
> *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
> warnings.
> *   Adding redirector header for <functional> and <tr1/functional>.  Since 
> namespaces aren't consistent (std vs std::tr1), I have added symbols to 
> the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
> support
> *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
> now correctly sleeps for seconds, and usleep attempts to sleep for 
> microseconds (after converting very coarsely to milliseconds).
> *   Adding support for using C++11 std::thread (and mutex, and monitor). 
> Thrift already supported boost::thread and posix threads.  Clients that 
> use std::thread no longer need built boost libraries.  The boost headers 
> are sufficient for them.  Switching from boost::thread to std::thread 
> resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
> and below will use boost::thread, msvc11 and up will use std::thread.
> *   Fixing more 64-bit socket truncation issues in non-blocking server and 
> ssl support.  openssl itself has socket truncation issues, so I could not 
> fix them all.
> *   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
> ".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
> *   Making TFileTransport use thrift style threads instead of redoing all 
> the pthread+boost stuff itself.
> *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
> and iOS)
> *   Moved several functions out of thrift/windows/config.h, and into other 
> thrift/windows headers.
> *   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
> using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Posted by "Ben Craig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13509479#comment-13509479 ] 

Ben Craig commented on THRIFT-1753:
-----------------------------------

I should have a patch tomorrow.  Turns out threads work better when you start them.  Who knew?
                
> Multiple C++ Windows, OSX, and iOS portability issues
> -----------------------------------------------------
>
>                 Key: THRIFT-1753
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9, 1.0
>         Environment: Windows MSVC10, MSVC11
> OSX GCC-4.2
> iOS Clang-4.0
>            Reporter: Ben Craig
>             Fix For: 1.0
>
>         Attachments: cleaner_port3.patch
>
>
> These are all in the C++ library.  Here is a summary of what I changed. 
> All of these fixes make a ~5000 line patch (though a lot of that is 
> deleted lines).
> *   General cleanup of the msvc project
> *   Using HAVE_CONFIG_H instead of force including files
> *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
> *   Significant rework of windows portability.  No longer using config.h 
> and force_inc.h to make Windows look like *nix.  Instead, making lots of 
> Thrift specific #defines that are vaguely *nixy, and having those forward 
> to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
> ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
> approach doesn't work when multiple libraries attempt the same trick.  For 
> example, if openssl #defined errno to ::WSAGetLastError() as well, then 
> that would cause problems.
> *   Adding preprocessor flag that can optionally squelch console output. 
> Default behavior is unchanged.  Console output is great for home deployed 
> server apps, but it looks unprofessional for consumer apps.
> *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
> warnings.
> *   Adding redirector header for <functional> and <tr1/functional>.  Since 
> namespaces aren't consistent (std vs std::tr1), I have added symbols to 
> the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
> support
> *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
> now correctly sleeps for seconds, and usleep attempts to sleep for 
> microseconds (after converting very coarsely to milliseconds).
> *   Adding support for using C++11 std::thread (and mutex, and monitor). 
> Thrift already supported boost::thread and posix threads.  Clients that 
> use std::thread no longer need built boost libraries.  The boost headers 
> are sufficient for them.  Switching from boost::thread to std::thread 
> resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
> and below will use boost::thread, msvc11 and up will use std::thread.
> *   Fixing more 64-bit socket truncation issues in non-blocking server and 
> ssl support.  openssl itself has socket truncation issues, so I could not 
> fix them all.
> *   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
> ".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
> *   Making TFileTransport use thrift style threads instead of redoing all 
> the pthread+boost stuff itself.
> *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
> and iOS)
> *   Moved several functions out of thrift/windows/config.h, and into other 
> thrift/windows headers.
> *   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
> using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Posted by "Ben Craig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Craig updated THRIFT-1753:
------------------------------

    Attachment: cleaner_port4.patch

Same as last patch, but now starting the TFileTransport flush thread, instead of just creating it and letting it do nothing.
                
> Multiple C++ Windows, OSX, and iOS portability issues
> -----------------------------------------------------
>
>                 Key: THRIFT-1753
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9, 1.0
>         Environment: Windows MSVC10, MSVC11
> OSX GCC-4.2
> iOS Clang-4.0
>            Reporter: Ben Craig
>             Fix For: 1.0
>
>         Attachments: cleaner_port3.patch, cleaner_port4.patch
>
>
> These are all in the C++ library.  Here is a summary of what I changed. 
> All of these fixes make a ~5000 line patch (though a lot of that is 
> deleted lines).
> *   General cleanup of the msvc project
> *   Using HAVE_CONFIG_H instead of force including files
> *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
> *   Significant rework of windows portability.  No longer using config.h 
> and force_inc.h to make Windows look like *nix.  Instead, making lots of 
> Thrift specific #defines that are vaguely *nixy, and having those forward 
> to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
> ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
> approach doesn't work when multiple libraries attempt the same trick.  For 
> example, if openssl #defined errno to ::WSAGetLastError() as well, then 
> that would cause problems.
> *   Adding preprocessor flag that can optionally squelch console output. 
> Default behavior is unchanged.  Console output is great for home deployed 
> server apps, but it looks unprofessional for consumer apps.
> *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
> warnings.
> *   Adding redirector header for <functional> and <tr1/functional>.  Since 
> namespaces aren't consistent (std vs std::tr1), I have added symbols to 
> the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
> support
> *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
> now correctly sleeps for seconds, and usleep attempts to sleep for 
> microseconds (after converting very coarsely to milliseconds).
> *   Adding support for using C++11 std::thread (and mutex, and monitor). 
> Thrift already supported boost::thread and posix threads.  Clients that 
> use std::thread no longer need built boost libraries.  The boost headers 
> are sufficient for them.  Switching from boost::thread to std::thread 
> resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
> and below will use boost::thread, msvc11 and up will use std::thread.
> *   Fixing more 64-bit socket truncation issues in non-blocking server and 
> ssl support.  openssl itself has socket truncation issues, so I could not 
> fix them all.
> *   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
> ".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
> *   Making TFileTransport use thrift style threads instead of redoing all 
> the pthread+boost stuff itself.
> *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
> and iOS)
> *   Moved several functions out of thrift/windows/config.h, and into other 
> thrift/windows headers.
> *   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
> using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (THRIFT-1753) Multiple C++ Windows, OSX, and iOS portability issues

Posted by "Roger Meier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13504946#comment-13504946 ] 

Roger Meier commented on THRIFT-1753:
-------------------------------------

Thanks for this large dinner Craig!

it hangs here right now... still waiting for the Dessert ;-r
{noformat}
Testing hm
PASS: SpecializationTest
TBinaryProtocol => OK
TCompactProtocol => OK
PASS: AllProtocolsTest
Timeout alarm expired; attempting to unblock transport
Timeout alarm expired; attempting to unblock transport
Timeout alarm expired; attempting to unblock transport
Timeout alarm expired; attempting to unblock transport
Timeout alarm expired; attempting to unblock transport
Timeout alarm expired; attempting to unblock transport
Timeout alarm expired; attempting to unblock transport
Timeout alarm expired; attempting to unblock transport
Timeout alarm expired; attempting to unblock transport
Timeout alarm expired; attempting to unblock transport

{noformat}
                
> Multiple C++ Windows, OSX, and iOS portability issues
> -----------------------------------------------------
>
>                 Key: THRIFT-1753
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1753
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9, 1.0
>         Environment: Windows MSVC10, MSVC11
> OSX GCC-4.2
> iOS Clang-4.0
>            Reporter: Ben Craig
>             Fix For: 1.0
>
>         Attachments: cleaner_port3.patch
>
>
> These are all in the C++ library.  Here is a summary of what I changed. 
> All of these fixes make a ~5000 line patch (though a lot of that is 
> deleted lines).
> *   General cleanup of the msvc project
> *   Using HAVE_CONFIG_H instead of force including files
> *   Getting rid of some unnecessary files (stdafx.*, TargetVersion.h)
> *   Significant rework of windows portability.  No longer using config.h 
> and force_inc.h to make Windows look like *nix.  Instead, making lots of 
> Thrift specific #defines that are vaguely *nixy, and having those forward 
> to *nix or Windows stuff appropriately.  For example, THRIFT_CTIME_R calls 
> ctime_r on *nix, and a wrapper thrift_ctime_r on Windows.  The old 
> approach doesn't work when multiple libraries attempt the same trick.  For 
> example, if openssl #defined errno to ::WSAGetLastError() as well, then 
> that would cause problems.
> *   Adding preprocessor flag that can optionally squelch console output. 
> Default behavior is unchanged.  Console output is great for home deployed 
> server apps, but it looks unprofessional for consumer apps.
> *   Adding THRIFT_UNUSED_VARIABLE helper macro, to aid in squelching 
> warnings.
> *   Adding redirector header for <functional> and <tr1/functional>.  Since 
> namespaces aren't consistent (std vs std::tr1), I have added symbols to 
> the apache::thrift::stdcxx namespace.  This is important for Clang / iOS 
> support
> *   usleep and sleep on Windows were both sleeping in milliseconds.  sleep 
> now correctly sleeps for seconds, and usleep attempts to sleep for 
> microseconds (after converting very coarsely to milliseconds).
> *   Adding support for using C++11 std::thread (and mutex, and monitor). 
> Thrift already supported boost::thread and posix threads.  Clients that 
> use std::thread no longer need built boost libraries.  The boost headers 
> are sufficient for them.  Switching from boost::thread to std::thread 
> resulted in a ~50k reduction in exe size in my tests.  By default, msvc10 
> and below will use boost::thread, msvc11 and up will use std::thread.
> *   Fixing more 64-bit socket truncation issues in non-blocking server and 
> ssl support.  openssl itself has socket truncation issues, so I could not 
> fix them all.
> *   Fixed THRIFT-1692 "SO_REUSEADDR allows for socket hijacking on Windows 
> ".  Now using SO_EXCLUSIVEADDRUSE on windows, and SO_REUSEADDR on *nix.
> *   Making TFileTransport use thrift style threads instead of redoing all 
> the pthread+boost stuff itself.
> *   Includes, and builds upon THRIFT-1740 (Make C++ library build on OS X 
> and iOS)
> *   Moved several functions out of thrift/windows/config.h, and into other 
> thrift/windows headers.
> *   Using built-in stdint.h on Windows if available (by checking HAVE_STDINT_H) and 
> using boost typedefs otherwise.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira