Fossil SCM
(cherry-pick): Define the NORETURN macro for MSVC
Commit
1112616e99047e3190c6b4494f23e917a04a255597f4f43fe0ee2556e4496d4c
Parent
dec3383ed428203…
4 files changed
+2
+2
+8
+8
+2
| --- src/config.h | ||
| +++ src/config.h | ||
| @@ -229,10 +229,12 @@ | ||
| 229 | 229 | /* |
| 230 | 230 | ** A marker for functions that never return. |
| 231 | 231 | */ |
| 232 | 232 | #if defined(__GNUC__) || defined(__clang__) |
| 233 | 233 | # define NORETURN __attribute__((__noreturn__)) |
| 234 | +#elif defined(_MSC_VER) && (_MSC_VER >= 1310) | |
| 235 | +# define NORETURN __declspec(noreturn) | |
| 234 | 236 | #else |
| 235 | 237 | # define NORETURN |
| 236 | 238 | #endif |
| 237 | 239 | |
| 238 | 240 | /* |
| 239 | 241 |
| --- 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 |
+2
| --- src/config.h | ||
| +++ src/config.h | ||
| @@ -229,10 +229,12 @@ | ||
| 229 | 229 | /* |
| 230 | 230 | ** A marker for functions that never return. |
| 231 | 231 | */ |
| 232 | 232 | #if defined(__GNUC__) || defined(__clang__) |
| 233 | 233 | # define NORETURN __attribute__((__noreturn__)) |
| 234 | +#elif defined(_MSC_VER) && (_MSC_VER >= 1310) | |
| 235 | +# define NORETURN __declspec(noreturn) | |
| 234 | 236 | #else |
| 235 | 237 | # define NORETURN |
| 236 | 238 | #endif |
| 237 | 239 | |
| 238 | 240 | /* |
| 239 | 241 |
| --- 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 |
+8
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -2083,10 +2083,11 @@ | ||
| 2083 | 2083 | ** output onto the end of a ShellText object. |
| 2084 | 2084 | */ |
| 2085 | 2085 | static int captureOutputCallback(void *pArg, int nArg, char **azArg, char **az){ |
| 2086 | 2086 | ShellText *p = (ShellText*)pArg; |
| 2087 | 2087 | int i; |
| 2088 | + UNUSED_PARAMETER(az); | |
| 2088 | 2089 | if( p->n ) appendText(p, "|", 0); |
| 2089 | 2090 | for(i=0; i<nArg; i++){ |
| 2090 | 2091 | if( i ) appendText(p, ",", 0); |
| 2091 | 2092 | if( azArg[i] ) appendText(p, azArg[i], 0); |
| 2092 | 2093 | } |
| @@ -4683,11 +4684,18 @@ | ||
| 4683 | 4684 | for(i=1; i<nArg; i++){ |
| 4684 | 4685 | if( azArg[i][0]=='-' ){ |
| 4685 | 4686 | const char *z = azArg[i]+1; |
| 4686 | 4687 | if( z[0]=='-' ) z++; |
| 4687 | 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 | |
| 4688 | 4695 | ShellSetFlag(p, SHFLG_PreserveRowid); |
| 4696 | +#endif | |
| 4689 | 4697 | }else |
| 4690 | 4698 | { |
| 4691 | 4699 | raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]); |
| 4692 | 4700 | rc = 1; |
| 4693 | 4701 | goto meta_command_exit; |
| 4694 | 4702 |
| --- 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 |
+8
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -2083,10 +2083,11 @@ | ||
| 2083 | 2083 | ** output onto the end of a ShellText object. |
| 2084 | 2084 | */ |
| 2085 | 2085 | static int captureOutputCallback(void *pArg, int nArg, char **azArg, char **az){ |
| 2086 | 2086 | ShellText *p = (ShellText*)pArg; |
| 2087 | 2087 | int i; |
| 2088 | + UNUSED_PARAMETER(az); | |
| 2088 | 2089 | if( p->n ) appendText(p, "|", 0); |
| 2089 | 2090 | for(i=0; i<nArg; i++){ |
| 2090 | 2091 | if( i ) appendText(p, ",", 0); |
| 2091 | 2092 | if( azArg[i] ) appendText(p, azArg[i], 0); |
| 2092 | 2093 | } |
| @@ -4683,11 +4684,18 @@ | ||
| 4683 | 4684 | for(i=1; i<nArg; i++){ |
| 4684 | 4685 | if( azArg[i][0]=='-' ){ |
| 4685 | 4686 | const char *z = azArg[i]+1; |
| 4686 | 4687 | if( z[0]=='-' ) z++; |
| 4687 | 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 | |
| 4688 | 4695 | ShellSetFlag(p, SHFLG_PreserveRowid); |
| 4696 | +#endif | |
| 4689 | 4697 | }else |
| 4690 | 4698 | { |
| 4691 | 4699 | raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]); |
| 4692 | 4700 | rc = 1; |
| 4693 | 4701 | goto meta_command_exit; |
| 4694 | 4702 |
| --- 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 |