Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c34ed86e
Commit
c34ed86e
authored
Sep 10, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow long long on BSDI.
parent
6d3a5482
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
4 deletions
+47
-4
src/configure.in
src/configure.in
+37
-1
src/include/utils/int8.h
src/include/utils/int8.h
+10
-3
No files found.
src/configure.in
View file @
c34ed86e
...
@@ -606,7 +606,43 @@ int does_int64_work()
...
@@ -606,7 +606,43 @@ int does_int64_work()
main() {
main() {
exit(! does_int64_work());
exit(! does_int64_work());
}],
}],
[AC_DEFINE(HAVE_LONG_LONG_INT_64) AC_MSG_RESULT(yes)],
[AC_DEFINE(HAVE_LONG_LONG_INT_64_Ld) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no),
AC_MSG_RESULT(assuming not on target machine))
AC_TRY_RUN([#include <stdio.h>
typedef long long int int64;
#define INT64_FORMAT "%qd"
int64 a = 20000001;
int64 b = 40000005;
int does_int64_work()
{
int64 c,d,e;
char buf[100];
if (sizeof(int64) != 8)
return 0; /* doesn't look like the right size */
/* we do perfunctory checks on multiply, divide, sprintf, sscanf */
c = a * b;
sprintf(buf, INT64_FORMAT, c);
if (strcmp(buf, "800000140000005") != 0)
return 0; /* either multiply or sprintf is busted */
if (sscanf(buf, INT64_FORMAT, &d) != 1)
return 0;
if (d != c)
return 0;
e = d / b;
if (e != a)
return 0;
return 1;
}
main() {
exit(! does_int64_work());
}],
[AC_DEFINE(HAVE_LONG_LONG_INT_64_qd) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no),
AC_MSG_RESULT(no),
AC_MSG_RESULT(assuming not on target machine))
AC_MSG_RESULT(assuming not on target machine))
...
...
src/include/utils/int8.h
View file @
c34ed86e
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: int8.h,v 1.
4 1998/09/05 01:19:38 thomas
Exp $
* $Id: int8.h,v 1.
5 1998/09/10 03:27:09 momjian
Exp $
*
*
* NOTES
* NOTES
* These data types are supported on all 64-bit architectures, and may
* These data types are supported on all 64-bit architectures, and may
...
@@ -29,11 +29,17 @@ typedef long int int64;
...
@@ -29,11 +29,17 @@ typedef long int int64;
#define INT64_FORMAT "%ld"
#define INT64_FORMAT "%ld"
#else
#else
#ifdef HAVE_LONG_LONG_INT_64
#ifdef HAVE_LONG_LONG_INT_64
_Ld
/* We have working support for "long long int", use that */
/* We have working support for "long long int", use that */
typedef
long
long
int
int64
;
typedef
long
long
int
int64
;
#define INT64_FORMAT "%lld"
#define INT64_FORMAT "%Ld"
#else
#ifdef HAVE_LONG_LONG_INT_64_qd
/* We have working support for "long long int", use that */
typedef
long
long
int
int64
;
#define INT64_FORMAT "%qd"
#else
#else
/* Won't actually work, but fall back to long int so that int8.c compiles */
/* Won't actually work, but fall back to long int so that int8.c compiles */
typedef
long
int
int64
;
typedef
long
int
int64
;
...
@@ -42,6 +48,7 @@ typedef long int int64;
...
@@ -42,6 +48,7 @@ typedef long int int64;
#define INT64_IS_BUSTED
#define INT64_IS_BUSTED
#endif
#endif
#endif
#endif
#endif
extern
int64
*
int8in
(
char
*
str
);
extern
int64
*
int8in
(
char
*
str
);
extern
char
*
int8out
(
int64
*
val
);
extern
char
*
int8out
(
int64
*
val
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment