aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-03-01 11:55:28 -0500
committerPeter Eisentraut <peter_e@gmx.net>2017-03-01 11:55:28 -0500
commit788af6f8541d5f30acec540e4fd3cb24f5347209 (patch)
tree16150f8aa906369c13578922ed33636c530bd529 /src
parentb5a388392dab4c4a7c0fbd6cd0ad7421eabfc5cf (diff)
downloadpostgresql-788af6f8541d5f30acec540e4fd3cb24f5347209.tar.gz
postgresql-788af6f8541d5f30acec540e4fd3cb24f5347209.zip
Move atooid() definition to a central place
Diffstat (limited to 'src')
-rw-r--r--src/backend/bootstrap/bootparse.y2
-rw-r--r--src/backend/libpq/hba.c3
-rw-r--r--src/backend/nodes/readfuncs.c2
-rw-r--r--src/backend/utils/adt/misc.c2
-rw-r--r--src/bin/pg_basebackup/pg_basebackup.c2
-rw-r--r--src/bin/pg_upgrade/pg_upgrade.h2
-rw-r--r--src/bin/psql/common.h2
-rw-r--r--src/bin/scripts/droplang.c2
-rw-r--r--src/include/fe_utils/string_utils.h2
-rw-r--r--src/include/postgres_ext.h4
10 files changed, 4 insertions, 19 deletions
diff --git a/src/backend/bootstrap/bootparse.y b/src/backend/bootstrap/bootparse.y
index 33d9f0b3c67..867f77076d0 100644
--- a/src/backend/bootstrap/bootparse.y
+++ b/src/backend/bootstrap/bootparse.y
@@ -51,8 +51,6 @@
#include "tcop/dest.h"
#include "utils/rel.h"
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-
/*
* Bison doesn't allocate anything that needs to live across parser calls,
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c
index be63a4bc637..323bfa858d7 100644
--- a/src/backend/libpq/hba.c
+++ b/src/backend/libpq/hba.c
@@ -52,9 +52,6 @@
#endif
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-#define atoxid(x) ((TransactionId) strtoul((x), NULL, 10))
-
#define MAX_TOKEN 256
#define MAX_LINE 8192
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c
index d2f69fe70ba..05bf2e93e6b 100644
--- a/src/backend/nodes/readfuncs.c
+++ b/src/backend/nodes/readfuncs.c
@@ -164,8 +164,6 @@
*/
#define atoui(x) ((unsigned int) strtoul((x), NULL, 10))
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-
#define strtobool(x) ((*(x) == 't') ? true : false)
#define nullable_string(token,length) \
diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c
index 0116fa08a61..8f7c1f81fd4 100644
--- a/src/backend/utils/adt/misc.c
+++ b/src/backend/utils/adt/misc.c
@@ -44,8 +44,6 @@
#include "utils/builtins.h"
#include "utils/timestamp.h"
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-
/*
* Common subroutine for num_nulls() and num_nonnulls().
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 4b75e765bb8..0a4944dd66e 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -39,8 +39,6 @@
#include "streamutil.h"
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-
typedef struct TablespaceListCell
{
struct TablespaceListCell *next;
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h
index 968ab8a668f..b78b877903d 100644
--- a/src/bin/pg_upgrade/pg_upgrade.h
+++ b/src/bin/pg_upgrade/pg_upgrade.h
@@ -97,8 +97,6 @@ extern char *output_files[];
#define CLUSTER_NAME(cluster) ((cluster) == &old_cluster ? "old" : \
(cluster) == &new_cluster ? "new" : "none")
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-
/* OID system catalog preservation added during PG 9.0 development */
#define TABLE_SPACE_SUBDIRS_CAT_VER 201001111
/* postmaster/postgres -b (binary_upgrade) flag added during PG 9.1 development */
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index dad0eb822a5..a83bc69ab75 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -13,8 +13,6 @@
#include "libpq-fe.h"
#include "fe_utils/print.h"
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-
extern bool openQueryOutputFile(const char *fname, FILE **fout, bool *is_pipe);
extern bool setQFout(const char *fname);
diff --git a/src/bin/scripts/droplang.c b/src/bin/scripts/droplang.c
index ab0215d4954..97d1de43ae8 100644
--- a/src/bin/scripts/droplang.c
+++ b/src/bin/scripts/droplang.c
@@ -14,8 +14,6 @@
#include "common.h"
#include "fe_utils/print.h"
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-
static void help(const char *progname);
diff --git a/src/include/fe_utils/string_utils.h b/src/include/fe_utils/string_utils.h
index 8f96a0b9919..6fb7f5e30ec 100644
--- a/src/include/fe_utils/string_utils.h
+++ b/src/include/fe_utils/string_utils.h
@@ -19,8 +19,6 @@
#include "libpq-fe.h"
#include "pqexpbuffer.h"
-#define atooid(x) ((Oid) strtoul((x), NULL, 10))
-
/* Global variables controlling behavior of fmtId() and fmtQualifiedId() */
extern int quote_all_identifiers;
extern PQExpBuffer (*getLocalPQExpBuffer) (void);
diff --git a/src/include/postgres_ext.h b/src/include/postgres_ext.h
index ae2f0877988..452eae9935e 100644
--- a/src/include/postgres_ext.h
+++ b/src/include/postgres_ext.h
@@ -39,6 +39,10 @@ typedef unsigned int Oid;
#define OID_MAX UINT_MAX
/* you will need to include <limits.h> to use the above #define */
+#define atooid(x) ((Oid) strtoul((x), NULL, 10))
+/* the above needs <stdlib.h> */
+
+
/* Define a signed 64-bit integer type for use in client API declarations. */
typedef PG_INT64_TYPE pg_int64;