Fossil SCM

(cherry-pick): Define the NORETURN macro for MSVC

jan.nijtmans 2017-03-25 19:15 UTC branch-2.1
Commit 1112616e99047e3190c6b4494f23e917a04a255597f4f43fe0ee2556e4496d4c
--- src/config.h
+++ src/config.h
@@ -229,10 +229,12 @@
229229
/*
230230
** A marker for functions that never return.
231231
*/
232232
#if defined(__GNUC__) || defined(__clang__)
233233
# define NORETURN __attribute__((__noreturn__))
234
+#elif defined(_MSC_VER) && (_MSC_VER >= 1310)
235
+# define NORETURN __declspec(noreturn)
234236
#else
235237
# define NORETURN
236238
#endif
237239
238240
/*
239241
--- src/config.h
+++ src/config.h
@@ -229,10 +229,12 @@
229 /*
230 ** A marker for functions that never return.
231 */
232 #if defined(__GNUC__) || defined(__clang__)
233 # define NORETURN __attribute__((__noreturn__))
 
 
234 #else
235 # define NORETURN
236 #endif
237
238 /*
239
--- src/config.h
+++ src/config.h
@@ -229,10 +229,12 @@
229 /*
230 ** A marker for functions that never return.
231 */
232 #if defined(__GNUC__) || defined(__clang__)
233 # define NORETURN __attribute__((__noreturn__))
234 #elif defined(_MSC_VER) && (_MSC_VER >= 1310)
235 # define NORETURN __declspec(noreturn)
236 #else
237 # define NORETURN
238 #endif
239
240 /*
241
--- src/config.h
+++ src/config.h
@@ -229,10 +229,12 @@
229229
/*
230230
** A marker for functions that never return.
231231
*/
232232
#if defined(__GNUC__) || defined(__clang__)
233233
# define NORETURN __attribute__((__noreturn__))
234
+#elif defined(_MSC_VER) && (_MSC_VER >= 1310)
235
+# define NORETURN __declspec(noreturn)
234236
#else
235237
# define NORETURN
236238
#endif
237239
238240
/*
239241
--- src/config.h
+++ src/config.h
@@ -229,10 +229,12 @@
229 /*
230 ** A marker for functions that never return.
231 */
232 #if defined(__GNUC__) || defined(__clang__)
233 # define NORETURN __attribute__((__noreturn__))
 
 
234 #else
235 # define NORETURN
236 #endif
237
238 /*
239
--- src/config.h
+++ src/config.h
@@ -229,10 +229,12 @@
229 /*
230 ** A marker for functions that never return.
231 */
232 #if defined(__GNUC__) || defined(__clang__)
233 # define NORETURN __attribute__((__noreturn__))
234 #elif defined(_MSC_VER) && (_MSC_VER >= 1310)
235 # define NORETURN __declspec(noreturn)
236 #else
237 # define NORETURN
238 #endif
239
240 /*
241
--- src/shell.c
+++ src/shell.c
@@ -2083,10 +2083,11 @@
20832083
** output onto the end of a ShellText object.
20842084
*/
20852085
static int captureOutputCallback(void *pArg, int nArg, char **azArg, char **az){
20862086
ShellText *p = (ShellText*)pArg;
20872087
int i;
2088
+ UNUSED_PARAMETER(az);
20882089
if( p->n ) appendText(p, "|", 0);
20892090
for(i=0; i<nArg; i++){
20902091
if( i ) appendText(p, ",", 0);
20912092
if( azArg[i] ) appendText(p, azArg[i], 0);
20922093
}
@@ -4683,11 +4684,18 @@
46834684
for(i=1; i<nArg; i++){
46844685
if( azArg[i][0]=='-' ){
46854686
const char *z = azArg[i]+1;
46864687
if( z[0]=='-' ) z++;
46874688
if( strcmp(z,"preserve-rowids")==0 ){
4689
+#ifdef SQLITE_OMIT_VIRTUALTABLE
4690
+ raw_printf(stderr, "The --preserve-rowids option is not compatible"
4691
+ " with SQLITE_OMIT_VIRTUALTABLE\n");
4692
+ rc = 1;
4693
+ goto meta_command_exit;
4694
+#else
46884695
ShellSetFlag(p, SHFLG_PreserveRowid);
4696
+#endif
46894697
}else
46904698
{
46914699
raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
46924700
rc = 1;
46934701
goto meta_command_exit;
46944702
--- src/shell.c
+++ src/shell.c
@@ -2083,10 +2083,11 @@
2083 ** output onto the end of a ShellText object.
2084 */
2085 static int captureOutputCallback(void *pArg, int nArg, char **azArg, char **az){
2086 ShellText *p = (ShellText*)pArg;
2087 int i;
 
2088 if( p->n ) appendText(p, "|", 0);
2089 for(i=0; i<nArg; i++){
2090 if( i ) appendText(p, ",", 0);
2091 if( azArg[i] ) appendText(p, azArg[i], 0);
2092 }
@@ -4683,11 +4684,18 @@
4683 for(i=1; i<nArg; i++){
4684 if( azArg[i][0]=='-' ){
4685 const char *z = azArg[i]+1;
4686 if( z[0]=='-' ) z++;
4687 if( strcmp(z,"preserve-rowids")==0 ){
 
 
 
 
 
 
4688 ShellSetFlag(p, SHFLG_PreserveRowid);
 
4689 }else
4690 {
4691 raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
4692 rc = 1;
4693 goto meta_command_exit;
4694
--- src/shell.c
+++ src/shell.c
@@ -2083,10 +2083,11 @@
2083 ** output onto the end of a ShellText object.
2084 */
2085 static int captureOutputCallback(void *pArg, int nArg, char **azArg, char **az){
2086 ShellText *p = (ShellText*)pArg;
2087 int i;
2088 UNUSED_PARAMETER(az);
2089 if( p->n ) appendText(p, "|", 0);
2090 for(i=0; i<nArg; i++){
2091 if( i ) appendText(p, ",", 0);
2092 if( azArg[i] ) appendText(p, azArg[i], 0);
2093 }
@@ -4683,11 +4684,18 @@
4684 for(i=1; i<nArg; i++){
4685 if( azArg[i][0]=='-' ){
4686 const char *z = azArg[i]+1;
4687 if( z[0]=='-' ) z++;
4688 if( strcmp(z,"preserve-rowids")==0 ){
4689 #ifdef SQLITE_OMIT_VIRTUALTABLE
4690 raw_printf(stderr, "The --preserve-rowids option is not compatible"
4691 " with SQLITE_OMIT_VIRTUALTABLE\n");
4692 rc = 1;
4693 goto meta_command_exit;
4694 #else
4695 ShellSetFlag(p, SHFLG_PreserveRowid);
4696 #endif
4697 }else
4698 {
4699 raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
4700 rc = 1;
4701 goto meta_command_exit;
4702
--- src/shell.c
+++ src/shell.c
@@ -2083,10 +2083,11 @@
20832083
** output onto the end of a ShellText object.
20842084
*/
20852085
static int captureOutputCallback(void *pArg, int nArg, char **azArg, char **az){
20862086
ShellText *p = (ShellText*)pArg;
20872087
int i;
2088
+ UNUSED_PARAMETER(az);
20882089
if( p->n ) appendText(p, "|", 0);
20892090
for(i=0; i<nArg; i++){
20902091
if( i ) appendText(p, ",", 0);
20912092
if( azArg[i] ) appendText(p, azArg[i], 0);
20922093
}
@@ -4683,11 +4684,18 @@
46834684
for(i=1; i<nArg; i++){
46844685
if( azArg[i][0]=='-' ){
46854686
const char *z = azArg[i]+1;
46864687
if( z[0]=='-' ) z++;
46874688
if( strcmp(z,"preserve-rowids")==0 ){
4689
+#ifdef SQLITE_OMIT_VIRTUALTABLE
4690
+ raw_printf(stderr, "The --preserve-rowids option is not compatible"
4691
+ " with SQLITE_OMIT_VIRTUALTABLE\n");
4692
+ rc = 1;
4693
+ goto meta_command_exit;
4694
+#else
46884695
ShellSetFlag(p, SHFLG_PreserveRowid);
4696
+#endif
46894697
}else
46904698
{
46914699
raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
46924700
rc = 1;
46934701
goto meta_command_exit;
46944702
--- src/shell.c
+++ src/shell.c
@@ -2083,10 +2083,11 @@
2083 ** output onto the end of a ShellText object.
2084 */
2085 static int captureOutputCallback(void *pArg, int nArg, char **azArg, char **az){
2086 ShellText *p = (ShellText*)pArg;
2087 int i;
 
2088 if( p->n ) appendText(p, "|", 0);
2089 for(i=0; i<nArg; i++){
2090 if( i ) appendText(p, ",", 0);
2091 if( azArg[i] ) appendText(p, azArg[i], 0);
2092 }
@@ -4683,11 +4684,18 @@
4683 for(i=1; i<nArg; i++){
4684 if( azArg[i][0]=='-' ){
4685 const char *z = azArg[i]+1;
4686 if( z[0]=='-' ) z++;
4687 if( strcmp(z,"preserve-rowids")==0 ){
 
 
 
 
 
 
4688 ShellSetFlag(p, SHFLG_PreserveRowid);
 
4689 }else
4690 {
4691 raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
4692 rc = 1;
4693 goto meta_command_exit;
4694
--- src/shell.c
+++ src/shell.c
@@ -2083,10 +2083,11 @@
2083 ** output onto the end of a ShellText object.
2084 */
2085 static int captureOutputCallback(void *pArg, int nArg, char **azArg, char **az){
2086 ShellText *p = (ShellText*)pArg;
2087 int i;
2088 UNUSED_PARAMETER(az);
2089 if( p->n ) appendText(p, "|", 0);
2090 for(i=0; i<nArg; i++){
2091 if( i ) appendText(p, ",", 0);
2092 if( azArg[i] ) appendText(p, azArg[i], 0);
2093 }
@@ -4683,11 +4684,18 @@
4684 for(i=1; i<nArg; i++){
4685 if( azArg[i][0]=='-' ){
4686 const char *z = azArg[i]+1;
4687 if( z[0]=='-' ) z++;
4688 if( strcmp(z,"preserve-rowids")==0 ){
4689 #ifdef SQLITE_OMIT_VIRTUALTABLE
4690 raw_printf(stderr, "The --preserve-rowids option is not compatible"
4691 " with SQLITE_OMIT_VIRTUALTABLE\n");
4692 rc = 1;
4693 goto meta_command_exit;
4694 #else
4695 ShellSetFlag(p, SHFLG_PreserveRowid);
4696 #endif
4697 }else
4698 {
4699 raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
4700 rc = 1;
4701 goto meta_command_exit;
4702

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button