mirror of
https://github.com/moparisthebest/curl
synced 2024-11-15 14:05:03 -05:00
Respect HAVE_LONGLONG to support 'long long'
This commit is contained in:
parent
e16bc91601
commit
fb3eee5f0b
@ -38,10 +38,6 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef SIZEOF_LONG_LONG
|
|
||||||
/* prevents warnings on picky compilers */
|
|
||||||
#define SIZEOF_LONG_LONG 0
|
|
||||||
#endif
|
|
||||||
#ifndef SIZEOF_LONG_DOUBLE
|
#ifndef SIZEOF_LONG_DOUBLE
|
||||||
#define SIZEOF_LONG_DOUBLE 0
|
#define SIZEOF_LONG_DOUBLE 0
|
||||||
#endif
|
#endif
|
||||||
@ -125,7 +121,7 @@ typedef struct {
|
|||||||
char *str;
|
char *str;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
long num;
|
long num;
|
||||||
#if SIZEOF_LONG_LONG /* if this is non-zero */
|
#ifdef HAVE_LONGLONG
|
||||||
long long lnum;
|
long long lnum;
|
||||||
#endif
|
#endif
|
||||||
double dnum;
|
double dnum;
|
||||||
@ -517,7 +513,7 @@ static int dprintf_Pass1(char *format, va_stack_t *vto, char **endpos, va_list a
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FORMAT_INT:
|
case FORMAT_INT:
|
||||||
#if SIZEOF_LONG_LONG
|
#ifdef HAVE_LONGLONG
|
||||||
if(vto[i].flags & FLAGS_LONGLONG)
|
if(vto[i].flags & FLAGS_LONGLONG)
|
||||||
vto[i].data.lnum = va_arg(arglist, long long);
|
vto[i].data.lnum = va_arg(arglist, long long);
|
||||||
else
|
else
|
||||||
@ -604,7 +600,7 @@ static int dprintf_formatf(
|
|||||||
long base;
|
long base;
|
||||||
|
|
||||||
/* Integral values to be written. */
|
/* Integral values to be written. */
|
||||||
#if SIZEOF_LONG_LONG
|
#ifdef HAVE_LONGLONG
|
||||||
unsigned long long num;
|
unsigned long long num;
|
||||||
#else
|
#else
|
||||||
unsigned long num;
|
unsigned long num;
|
||||||
@ -697,9 +693,9 @@ static int dprintf_formatf(
|
|||||||
/* Decimal integer. */
|
/* Decimal integer. */
|
||||||
base = 10;
|
base = 10;
|
||||||
|
|
||||||
#if SIZEOF_LONG_LONG
|
#ifdef HAVE_LONGLONG
|
||||||
if(p->flags & FLAGS_LONGLONG) {
|
if(p->flags & FLAGS_LONGLONG) {
|
||||||
/* long long */
|
/* long long */
|
||||||
is_neg = p->data.lnum < 0;
|
is_neg = p->data.lnum < 0;
|
||||||
num = is_neg ? (- p->data.lnum) : p->data.lnum;
|
num = is_neg ? (- p->data.lnum) : p->data.lnum;
|
||||||
}
|
}
|
||||||
@ -928,7 +924,7 @@ static int dprintf_formatf(
|
|||||||
|
|
||||||
case FORMAT_INTPTR:
|
case FORMAT_INTPTR:
|
||||||
/* Answer the count of characters written. */
|
/* Answer the count of characters written. */
|
||||||
#if SIZEOF_LONG_LONG
|
#ifdef HAVE_LONGLONG
|
||||||
if (p->flags & FLAGS_LONGLONG)
|
if (p->flags & FLAGS_LONGLONG)
|
||||||
*(long long int *) p->data.ptr = done;
|
*(long long int *) p->data.ptr = done;
|
||||||
else
|
else
|
||||||
@ -1147,7 +1143,7 @@ int main()
|
|||||||
{
|
{
|
||||||
char buffer[129];
|
char buffer[129];
|
||||||
char *ptr;
|
char *ptr;
|
||||||
#if SIZEOF_LONG_LONG>0
|
#ifdef HAVE_LONGLONG
|
||||||
long long hullo;
|
long long hullo;
|
||||||
dprintf("%3$12s %1$s %2$qd %4$d\n", "daniel", hullo, "stenberg", 65);
|
dprintf("%3$12s %1$s %2$qd %4$d\n", "daniel", hullo, "stenberg", 65);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user