Menu

#39 silence pragma warnings with MinGW

Unstable_(example)
closed
nobody
None
5
2017-07-02
2017-07-01
Marshall
No
--- a/libdjvu/miniexp.cpp
+++ b/libdjvu/miniexp.cpp
@@ -382,6 +382,7 @@ static void NTAPI gctls_cb(PVOID, DWORD dwReason, PVOID) {
     {CSLOCK(r);TlsFree(tlsIndex);tlsIndex=TLS_OUT_OF_INDEXES;}
 }
 # endif
+#ifndef __GNUC__
 // -- Very black magic to clean tls variables.
 # ifdef _M_IX86
 #  pragma comment (linker, "/INCLUDE:_tlscb")
@@ -391,6 +392,7 @@ static void NTAPI gctls_cb(PVOID, DWORD dwReason, PVOID) {
 # pragma const_seg(".CRT$XLB")
 extern "C" PIMAGE_TLS_CALLBACK tlscb = gctls_cb;
 # pragma const_seg()
+#endif  /* !__GNUC__ */

 #else
 // No threads
1 Attachments

Discussion

  • Leon Bottou

    Leon Bottou - 2017-07-02
    • status: open --> closed
     
  • Leon Bottou

    Leon Bottou - 2017-07-02

    See comments to bug #274.
    Now it should show a warning...

     
    • Marshall

      Marshall - 2017-07-02

      If this only works with MSVC isn't it better do surround it by #ifdef _MSC_VER ?

       
      • Leon Bottou

        Leon Bottou - 2017-07-03

        It works with compilers that implement the MSVC pragmas (the intel compiler maybe).

        Anyway I just wanted to make sure it would either fail to compile or at least give a warning.

        L.

        From: Marshall darealshinji@users.sf.net
        Reply-To: "[djvu:patches]" 39@patches.djvu.p.re.sf.net
        Date: Sunday, July 2, 2017 at 4:49 PM
        To: "[djvu:patches]" 39@patches.djvu.p.re.sf.net
        Subject: [djvu:patches] Re: #39 silence pragma warnings with MinGW

        If this only works with MSVC isn't it better do surround it by #ifdef _MSC_VER ?

        [patches:#39] silence pragma warnings with MinGW

        Status: closed
        Group: Unstable_(example)
        Created: Sat Jul 01, 2017 01:06 AM UTC by Marshall
        Last Updated: Sun Jul 02, 2017 05:02 PM UTC
        Owner: nobody
        Attachments:
        pragma.patch (569 Bytes; text/x-patch)
        --- a/libdjvu/miniexp.cpp
        +++ b/libdjvu/miniexp.cpp
        @@ -382,6 +382,7 @@ static void NTAPI gctls_cb(PVOID, DWORD dwReason, PVOID) {
             {CSLOCK(r);TlsFree(tlsIndex);tlsIndex=TLS_OUT_OF_INDEXES;}
        }
        # endif
        +#ifndef GNUC
        // -- Very black magic to clean tls variables.
        # ifdef _M_IX86
        #  pragma comment (linker, "/INCLUDE:_tlscb")
        @@ -391,6 +392,7 @@ static void NTAPI gctls_cb(PVOID, DWORD dwReason, PVOID) {
        # pragma const_seg(".CRT$XLB")
        extern "C" PIMAGE_TLS_CALLBACK tlscb = gctls_cb;
        # pragma const_seg()
        +#endif  / !GNUC /

        #else
        // No threads
        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/djvu/patches/39/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         

Log in to post a comment.