[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-06 Thread Luuk


On 06-09-15 07:47, Scott Robison wrote:
> On Sat, Sep 5, 2015 at 9:58 PM, Keith Medcalf  wrote:
>
>> Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows.
>>
>> sqlite3x.c: In function 'sqlite3MemoryBarrier':
>> sqlite3x.c:20410:17: error: expected expression before ')' token
>> MemoryBarrier();
>>
>> /*
>> ** Try to provide a memory barrier operation, needed for initialization
>> only.
>> */
>> SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
>>MemoryBarrier();
>> }
>>
>> This references a definition in winnt.h
>>
>> #if _WIN32_WINNT >= _WIN32_WINNT_VISTA
>> # if defined(_AMD64_) || defined(__X86_64)
>> #  define MemoryBarrier __faststorefence
>>
>> # elif defined(_IA64_)
>>
>> #  define MemoryBarrier __mf
>> # else
>>
>> void __mingworg_MemoryBarrier(void);
>> #  define MemoryBarrier __mingworg_MemoryBarrier
>> # endif
>>
>> #else
>>
>> # define MemoryBarrier
>> #endif
>>
>> If the _WIN32_WINNT value is less than Windows 6/Vista [0x600] then the
>> error is generated.  If the version is 0x600 or greater, it compiles just
>> fine.
>>
>> Of course, versions of WinNT less than 6 are "no longer diddled by
>> Microsoft" (meaning they are stable development targets).
>>
> My Commodore 64 is a stable development target! Sweet!
>
no, because

SELECT *
FROM StableDevelopment
WHERE WinNTVersion<=6 AND Platform LIKE 'Commodore%'

returns no results.
(because WinNTVersion should return NULL)



[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-06 Thread Keith Medcalf
On Sunday, 6 September, 2015 04:32, Richard Hipp  said:

> On 9/5/15, Keith Medcalf  wrote:

> > Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows.

> Please retry after the latest check-in and let us know whether or not
> the problem has been resolved.

Confirmed that the compilation is now successful, both with _WIN32_WINTNT 0x501 
and 0x600







[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-06 Thread Richard Hipp
On 9/5/15, Keith Medcalf  wrote:
>
> Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows.
>

Please retry after the latest check-in and let us know whether or not
the problem has been resolved.

-- 
D. Richard Hipp
drh at sqlite.org


[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-06 Thread Scott Robison
On Sat, Sep 5, 2015 at 9:58 PM, Keith Medcalf  wrote:

>
> Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows.
>
> sqlite3x.c: In function 'sqlite3MemoryBarrier':
> sqlite3x.c:20410:17: error: expected expression before ')' token
>MemoryBarrier();
>
> /*
> ** Try to provide a memory barrier operation, needed for initialization
> only.
> */
> SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
>   MemoryBarrier();
> }
>
> This references a definition in winnt.h
>
> #if _WIN32_WINNT >= _WIN32_WINNT_VISTA
> # if defined(_AMD64_) || defined(__X86_64)
> #  define MemoryBarrier __faststorefence
>
> # elif defined(_IA64_)
>
> #  define MemoryBarrier __mf
> # else
>
>void __mingworg_MemoryBarrier(void);
> #  define MemoryBarrier __mingworg_MemoryBarrier
> # endif
>
> #else
>
> # define MemoryBarrier
> #endif
>
> If the _WIN32_WINNT value is less than Windows 6/Vista [0x600] then the
> error is generated.  If the version is 0x600 or greater, it compiles just
> fine.
>
> Of course, versions of WinNT less than 6 are "no longer diddled by
> Microsoft" (meaning they are stable development targets).
>

My Commodore 64 is a stable development target! Sweet!


[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-05 Thread Keith Medcalf

Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows.

sqlite3x.c: In function 'sqlite3MemoryBarrier':
sqlite3x.c:20410:17: error: expected expression before ')' token
   MemoryBarrier();

/*
** Try to provide a memory barrier operation, needed for initialization only.
*/
SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
  MemoryBarrier();
}

This references a definition in winnt.h

#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
# if defined(_AMD64_) || defined(__X86_64)
#  define MemoryBarrier __faststorefence

# elif defined(_IA64_)

#  define MemoryBarrier __mf
# else

   void __mingworg_MemoryBarrier(void);
#  define MemoryBarrier __mingworg_MemoryBarrier
# endif

#else

# define MemoryBarrier
#endif

If the _WIN32_WINNT value is less than Windows 6/Vista [0x600] then the error 
is generated.  If the version is 0x600 or greater, it compiles just fine.

Of course, versions of WinNT less than 6 are "no longer diddled by Microsoft" 
(meaning they are stable development targets).


> -Original Message-
> From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-
> bounces at mailinglists.sqlite.org] On Behalf Of Richard Hipp
> Sent: Saturday, 5 September, 2015 21:02
> To: General Discussion of SQLite Database
> Cc: Michael Catanzaro
> Subject: Re: [sqlite] Thread safety problem encountered by people working
> on WebKit
> 
> On 9/5/15, Darin Adler  wrote:
> > Hi folks.
> >
> > I?m sending this on behalf of Michael Catanzaro, a contributor to the
> WebKit
> > open source project, who is working on a WebKit bug report, "Crash when
> > WebCore::SQLiteFileSystem::openDatabase is called from multiple threads"
> > , which seems to be
> caused
> > by an issue in SQLite. In short, we've noticed many applications that
> use
> > WebKit crash when sqlite3_initialize is called simultaneously in
> multiple
> > threads in the Fedora platform
> > 
> > 
> > 
> >   despite the fact
> that
> > sqlite3_initialize is documented to be thread-safe and called
> automatically
> > by the library when needed < https://sqlite.org/c3ref/initialize.html>.
> >
> > Michael is planning a workaround in WebKit that will call
> sqlite3_initialize
> > manually exactly once before WebKit uses sqlite, using std::once to deal
> > with the thread safety issue.
> >
> > We?d like to file an SQLite bug report about this, and as I understand
> it,
> > the proper way for a newcomer to do that is to send mail here.
> >
> > In the process of trying to report this, Michael discovered that the
> page
> > explaining how to report bugs against SQLite
> >  lists an incorrect
> email
> > address, . Mail to that address is rejected.
> >
> 
> Thanks for the bug report.  Code which might fix this has been checked
> into trunk.  I have also corrected the email address on the bug-report
> procedures page.
> 
> --
> D. Richard Hipp
> drh at sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users