From fa8dadd4fa15e1051c97943032797037e9161450 Mon Sep 17 00:00:00 2001 From: Jason Teng Date: Fri, 12 Jan 2024 19:53:07 +0000 Subject: [PATCH] Revert "Change most instances of PGDLLIMPORT hooks to PGDLLEXPORT hooks so that they can be consumed by the Babelfish extension" This reverts commit 17b208917cb34e9b45f93673c60eaec5e889e1db, except for in scanner.h, where the core_yylex_hook still needs to be declared PGDLLEXPORT (or else there will be a server crash). --- src/include/access/attmap.h | 2 +- src/include/access/heapam.h | 8 +++---- src/include/access/transam.h | 2 +- src/include/access/tupconvert.h | 2 +- src/include/access/xact.h | 12 +++++------ src/include/catalog/catalog.h | 6 +++--- src/include/catalog/heap.h | 4 ++-- src/include/catalog/namespace.h | 6 +++--- src/include/catalog/objectaccess.h | 2 +- src/include/catalog/objectaddress.h | 2 +- src/include/catalog/pg_collation.h | 10 ++++----- src/include/commands/copy.h | 4 ++-- src/include/commands/defrem.h | 4 ++-- src/include/commands/sequence.h | 8 +++---- src/include/commands/tablecmds.h | 8 +++---- src/include/commands/trigger.h | 6 +++--- src/include/commands/typecmds.h | 2 +- src/include/commands/view.h | 4 ++-- src/include/executor/executor.h | 12 +++++------ src/include/executor/spi.h | 4 ++-- src/include/fmgr.h | 4 ++-- src/include/funcapi.h | 2 +- src/include/miscadmin.h | 4 ++-- src/include/nodes/nodeFuncs.h | 2 +- src/include/nodes/value.h | 2 +- src/include/optimizer/clauses.h | 4 ++-- src/include/optimizer/planner.h | 4 ++-- src/include/parser/analyze.h | 24 ++++++++++----------- src/include/parser/parse_clause.h | 6 +++--- src/include/parser/parse_coerce.h | 2 +- src/include/parser/parse_collate.h | 2 +- src/include/parser/parse_expr.h | 2 +- src/include/parser/parse_func.h | 4 ++-- src/include/parser/parse_relation.h | 2 +- src/include/parser/parse_target.h | 6 +++--- src/include/parser/parse_type.h | 4 ++-- src/include/parser/parse_utilcmd.h | 6 +++--- src/include/parser/parser.h | 14 ++++++------ src/include/parser/scansup.h | 2 +- src/include/pgstat.h | 8 +++---- src/include/postmaster/protocol_extension.h | 6 +++--- src/include/replication/logical.h | 2 +- src/include/storage/ipc.h | 2 +- src/include/storage/lock.h | 2 +- src/include/tcop/tcopprot.h | 2 +- src/include/tcop/utility.h | 6 +++--- src/include/utils/acl.h | 4 ++-- src/include/utils/builtins.h | 5 ++--- src/include/utils/guc_hooks.h | 2 +- src/include/utils/guc_tables.h | 4 ++-- src/include/utils/numeric.h | 2 +- src/include/utils/pg_locale.h | 2 +- src/include/utils/plancache.h | 4 ++-- src/include/utils/queryenvironment.h | 10 ++++----- src/include/utils/ruleutils.h | 2 +- 55 files changed, 132 insertions(+), 135 deletions(-) diff --git a/src/include/access/attmap.h b/src/include/access/attmap.h index 89551a41320..5ee0323fec2 100644 --- a/src/include/access/attmap.h +++ b/src/include/access/attmap.h @@ -51,6 +51,6 @@ extern AttrMap *build_attrmap_by_position(TupleDesc indesc, TupleDesc outdesc, const char *msg); typedef bool (*called_from_tsql_insert_exec_hook_type)(); -extern PGDLLEXPORT called_from_tsql_insert_exec_hook_type called_from_tsql_insert_exec_hook; +extern PGDLLIMPORT called_from_tsql_insert_exec_hook_type called_from_tsql_insert_exec_hook; #endif /* ATTMAP_H */ diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index d8e6965c096..1a95544151d 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -202,19 +202,19 @@ typedef struct HeapPageFreeze /* Hook for plugins to get control with visibility without providing a separate AM */ typedef bool (*table_variable_satisfies_visibility_hook_type) ( HeapTuple stup, Snapshot snapshot, Buffer buffer); -extern PGDLLEXPORT table_variable_satisfies_visibility_hook_type table_variable_satisfies_visibility_hook; +extern PGDLLIMPORT table_variable_satisfies_visibility_hook_type table_variable_satisfies_visibility_hook; typedef TM_Result (*table_variable_satisfies_update_hook_type) ( HeapTuple stup, CommandId curcid, Buffer buffer); -extern PGDLLEXPORT table_variable_satisfies_update_hook_type table_variable_satisfies_update_hook; +extern PGDLLIMPORT table_variable_satisfies_update_hook_type table_variable_satisfies_update_hook; typedef HTSV_Result (*table_variable_satisfies_vacuum_hook_type) ( HeapTuple stup, TransactionId OldestXmin, Buffer buffer); -extern PGDLLEXPORT table_variable_satisfies_vacuum_hook_type table_variable_satisfies_vacuum_hook; +extern PGDLLIMPORT table_variable_satisfies_vacuum_hook_type table_variable_satisfies_vacuum_hook; typedef HTSV_Result (*table_variable_satisfies_vacuum_horizon_hook_type) ( HeapTuple htup, Buffer buffer, TransactionId *dead_after); -extern PGDLLEXPORT table_variable_satisfies_vacuum_horizon_hook_type table_variable_satisfies_vacuum_horizon_hook; +extern PGDLLIMPORT table_variable_satisfies_vacuum_horizon_hook_type table_variable_satisfies_vacuum_horizon_hook; /* * HeapScanIsValid diff --git a/src/include/access/transam.h b/src/include/access/transam.h index a4c33aa6940..94469264b78 100644 --- a/src/include/access/transam.h +++ b/src/include/access/transam.h @@ -296,7 +296,7 @@ extern Oid GetNewObjectId(void); extern void StopGeneratingPinnedObjectIds(void); typedef void (*GetNewObjectId_hook_type) (VariableCache variableCache); -extern PGDLLEXPORT GetNewObjectId_hook_type GetNewObjectId_hook; +extern PGDLLIMPORT GetNewObjectId_hook_type GetNewObjectId_hook; #ifdef USE_ASSERT_CHECKING extern void AssertTransactionIdInAllowableRange(TransactionId xid); diff --git a/src/include/access/tupconvert.h b/src/include/access/tupconvert.h index 61f5cae0e07..b7ba9fa09a9 100644 --- a/src/include/access/tupconvert.h +++ b/src/include/access/tupconvert.h @@ -54,7 +54,7 @@ extern void free_conversion_map(TupleConversionMap *map); typedef Datum (*exec_tsql_cast_value_hook_type)(Datum value, bool *isnull, Oid valtype, int32 valtypmod, Oid reqtype, int32 reqtypmod); -extern PGDLLEXPORT exec_tsql_cast_value_hook_type exec_tsql_cast_value_hook; +extern PGDLLIMPORT exec_tsql_cast_value_hook_type exec_tsql_cast_value_hook; #endif /* TUPCONVERT_H */ diff --git a/src/include/access/xact.h b/src/include/access/xact.h index 024c60991ca..74c674e81c8 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -527,13 +527,13 @@ extern void EnterParallelMode(void); extern void ExitParallelMode(void); extern bool IsInParallelMode(void); -extern PGDLLEXPORT bool IsTopTransactionName(const char *name); -extern PGDLLEXPORT void SetTopTransactionName(const char *name); -extern PGDLLEXPORT bool IsTransactionBlockActive(void); -extern PGDLLEXPORT void RollbackAndReleaseSavepoint(const char *name); +extern bool IsTopTransactionName(const char *name); +extern void SetTopTransactionName(const char *name); +extern bool IsTransactionBlockActive(void); +extern void RollbackAndReleaseSavepoint(const char *name); /* Nested transaction count */ -extern PGDLLEXPORT uint32 NestedTranCount; -extern PGDLLEXPORT bool AbortCurTransaction; +extern uint32 NestedTranCount; +extern bool AbortCurTransaction; #endif /* XACT_H */ diff --git a/src/include/catalog/catalog.h b/src/include/catalog/catalog.h index d387826fdb9..222e3612017 100644 --- a/src/include/catalog/catalog.h +++ b/src/include/catalog/catalog.h @@ -43,12 +43,12 @@ extern RelFileNumber GetNewRelFileNumber(Oid reltablespace, char relpersistence); typedef bool (*IsExtendedCatalogHookType) (Oid relationId); -extern PGDLLEXPORT IsExtendedCatalogHookType IsExtendedCatalogHook; +extern IsExtendedCatalogHookType IsExtendedCatalogHook; typedef bool (*IsToastRelationHookType) (Relation relation); -extern PGDLLEXPORT IsToastRelationHookType IsToastRelationHook; +extern IsToastRelationHookType IsToastRelationHook; typedef bool (*IsToastClassHookType) (Form_pg_class pg_class_tup); -extern PGDLLEXPORT IsToastClassHookType IsToastClassHook; +extern IsToastClassHookType IsToastClassHook; #endif /* CATALOG_H */ diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h index 2410665adb4..0da732bc9d9 100644 --- a/src/include/catalog/heap.h +++ b/src/include/catalog/heap.h @@ -161,9 +161,9 @@ extern void StorePartitionBound(Relation rel, Relation parent, /* Hook for plugins to transform executable expressions in check constraint clause */ typedef Node* (*transform_check_constraint_expr_hook_type) (Node *node); -extern PGDLLEXPORT transform_check_constraint_expr_hook_type transform_check_constraint_expr_hook; +extern PGDLLIMPORT transform_check_constraint_expr_hook_type transform_check_constraint_expr_hook; typedef void (*drop_relation_refcnt_hook_type) (Relation rel); -extern PGDLLEXPORT drop_relation_refcnt_hook_type drop_relation_refcnt_hook; +extern PGDLLIMPORT drop_relation_refcnt_hook_type drop_relation_refcnt_hook; #endif /* HEAP_H */ diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h index 37d85cc2d89..959b2f44b19 100644 --- a/src/include/catalog/namespace.h +++ b/src/include/catalog/namespace.h @@ -82,13 +82,13 @@ typedef void (*RangeVarGetRelidCallback) (const RangeVar *relation, Oid relId, * Hook for additional temporary relation lookup */ typedef Oid (*relname_lookup_hook_type) (const char *relname, Oid relnamespace); -extern PGDLLEXPORT relname_lookup_hook_type relname_lookup_hook; +extern PGDLLIMPORT relname_lookup_hook_type relname_lookup_hook; typedef bool (*match_pltsql_func_call_hook_type) (HeapTuple proctup, int nargs, List *argnames, bool include_out_arguments, int **argnumbers, List **defaults, bool expand_defaults, bool expand_variadic, bool *use_defaults, bool *any_special, bool *variadic, Oid *va_elem_type); -extern PGDLLEXPORT match_pltsql_func_call_hook_type match_pltsql_func_call_hook; +extern PGDLLIMPORT match_pltsql_func_call_hook_type match_pltsql_func_call_hook; #define RangeVarGetRelid(relation, lockmode, missing_ok) \ RangeVarGetRelidExtended(relation, lockmode, \ @@ -108,7 +108,7 @@ extern bool RelationIsVisible(Oid relid); extern Oid TypenameGetTypid(const char *typname); extern Oid TypenameGetTypidExtended(const char *typname, bool temp_ok); -extern PGDLLEXPORT Oid typenameGetSchemaOID(const char *typname, bool temp_ok); +extern Oid typenameGetSchemaOID(const char *typname, bool temp_ok); extern bool TypeIsVisible(Oid typid); extern FuncCandidateList FuncnameGetCandidates(List *names, diff --git a/src/include/catalog/objectaccess.h b/src/include/catalog/objectaccess.h index b5c8350fa22..d8145dd4c63 100644 --- a/src/include/catalog/objectaccess.h +++ b/src/include/catalog/objectaccess.h @@ -137,7 +137,7 @@ typedef void (*object_access_hook_type_str) (ObjectAccessType access, void *arg); /* Plugin sets this variable to a suitable hook function. */ -extern PGDLLEXPORT object_access_hook_type object_access_hook; +extern PGDLLIMPORT object_access_hook_type object_access_hook; extern PGDLLIMPORT object_access_hook_type_str object_access_hook_str; diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h index 4550ee26035..3e667d8ca8a 100644 --- a/src/include/catalog/objectaddress.h +++ b/src/include/catalog/objectaddress.h @@ -87,6 +87,6 @@ extern struct ArrayType *strlist_to_textarray(List *list); extern ObjectType get_relkind_objtype(char relkind); typedef ObjectAddress (*get_trigger_object_address_hook_type)(List *object, Relation *relp, bool missing_ok,bool object_from_input); -extern PGDLLEXPORT get_trigger_object_address_hook_type get_trigger_object_address_hook; +extern PGDLLIMPORT get_trigger_object_address_hook_type get_trigger_object_address_hook; #endif /* OBJECTADDRESS_H */ diff --git a/src/include/catalog/pg_collation.h b/src/include/catalog/pg_collation.h index 7a119275136..74352775df8 100644 --- a/src/include/catalog/pg_collation.h +++ b/src/include/catalog/pg_collation.h @@ -100,7 +100,7 @@ extern Oid CLUSTER_COLLATION_OID(void); /* Hook for plugins to get control in CLUSTER_COLLATION_OID() */ typedef Oid (*CLUSTER_COLLATION_OID_hook_type)(void); -extern PGDLLEXPORT CLUSTER_COLLATION_OID_hook_type CLUSTER_COLLATION_OID_hook; +extern PGDLLIMPORT CLUSTER_COLLATION_OID_hook_type CLUSTER_COLLATION_OID_hook; typedef void (*PreCreateCollation_hook_type) (char collprovider, bool collisdeterministic, @@ -108,15 +108,15 @@ typedef void (*PreCreateCollation_hook_type) (char collprovider, const char **collcollate, /* The pointer may be modified */ const char **collctype, /* The pointer may be modified */ const char *collversion); -extern PGDLLEXPORT PreCreateCollation_hook_type PreCreateCollation_hook; +extern PGDLLIMPORT PreCreateCollation_hook_type PreCreateCollation_hook; typedef const char * (*TranslateCollation_hook_type) (const char *collname, Oid collnamespace, int32 encoding); -extern PGDLLEXPORT TranslateCollation_hook_type TranslateCollation_hook; +extern PGDLLIMPORT TranslateCollation_hook_type TranslateCollation_hook; typedef void (*set_like_collation_hook_type) (Oid collation); -extern PGDLLEXPORT set_like_collation_hook_type set_like_collation_hook; +extern PGDLLIMPORT set_like_collation_hook_type set_like_collation_hook; typedef Oid (*get_like_collation_hook_type) (void); -extern PGDLLEXPORT get_like_collation_hook_type get_like_collation_hook; +extern PGDLLIMPORT get_like_collation_hook_type get_like_collation_hook; #endif /* PG_COLLATION_H */ diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h index 0344dbe59fc..79485f3e396 100644 --- a/src/include/commands/copy.h +++ b/src/include/commands/copy.h @@ -101,8 +101,8 @@ extern List *CopyGetAttnums(TupleDesc tupDesc, Relation rel, List *attnamelist); typedef bool (*is_tsql_rowversion_or_timestamp_datatype_hook_type)(Oid oid); -extern PGDLLEXPORT is_tsql_rowversion_or_timestamp_datatype_hook_type is_tsql_rowversion_or_timestamp_datatype_hook; +extern PGDLLIMPORT is_tsql_rowversion_or_timestamp_datatype_hook_type is_tsql_rowversion_or_timestamp_datatype_hook; typedef void (*fill_missing_values_in_copyfrom_hook_type)(Relation rel, Datum *values, bool *nulls); -extern PGDLLEXPORT fill_missing_values_in_copyfrom_hook_type fill_missing_values_in_copyfrom_hook; +extern PGDLLIMPORT fill_missing_values_in_copyfrom_hook_type fill_missing_values_in_copyfrom_hook; #endif /* COPY_H */ diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index a01e50eb23f..2082d6ce38c 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -78,8 +78,8 @@ extern void interpret_function_parameter_list(ParseState *pstate, typedef bool (*check_lang_as_clause_hook_type)(const char *lang, List *as, char **prosrc_str_p, char **probin_str_p); typedef void (*write_stored_proc_probin_hook_type)(CreateFunctionStmt *stmt, Oid languageOid, char** probin_str_p); -extern PGDLLEXPORT check_lang_as_clause_hook_type check_lang_as_clause_hook; -extern PGDLLEXPORT write_stored_proc_probin_hook_type write_stored_proc_probin_hook; +extern PGDLLIMPORT check_lang_as_clause_hook_type check_lang_as_clause_hook; +extern PGDLLIMPORT write_stored_proc_probin_hook_type write_stored_proc_probin_hook; /* commands/operatorcmds.c */ extern ObjectAddress DefineOperator(List *names, List *parameters); diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h index 0875b08a442..3d1030e2d39 100644 --- a/src/include/commands/sequence.h +++ b/src/include/commands/sequence.h @@ -26,7 +26,7 @@ typedef void (*pltsql_sequence_validate_increment_hook_type) (int64 increment_by, int64 max_value, int64 min_value); -extern PGDLLEXPORT pltsql_sequence_validate_increment_hook_type pltsql_sequence_validate_increment_hook; +extern PGDLLIMPORT pltsql_sequence_validate_increment_hook_type pltsql_sequence_validate_increment_hook; /* Sequence datatype hook */ typedef void (*pltsql_sequence_datatype_hook_type) (ParseState *pstate, @@ -35,15 +35,15 @@ typedef void (*pltsql_sequence_datatype_hook_type) (ParseState *pstate, DefElem *as_type, DefElem **max_value, DefElem **min_value); -extern PGDLLEXPORT pltsql_sequence_datatype_hook_type pltsql_sequence_datatype_hook; +extern PGDLLIMPORT pltsql_sequence_datatype_hook_type pltsql_sequence_datatype_hook; /* Sequence nextval hook */ typedef void (*pltsql_nextval_hook_type) (Oid seqid, int64 val); -extern PGDLLEXPORT pltsql_nextval_hook_type pltsql_nextval_hook; +extern PGDLLIMPORT pltsql_nextval_hook_type pltsql_nextval_hook; /* Sequence reset cache hook */ typedef void (*pltsql_resetcache_hook_type) (); -extern PGDLLEXPORT pltsql_resetcache_hook_type pltsql_resetcache_hook; +extern PGDLLIMPORT pltsql_resetcache_hook_type pltsql_resetcache_hook; /* Sequence setval hook */ typedef int64 (*pltsql_setval_hook_type) (Oid seqid, int64 val, int64 last_val); diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h index 3acca3ac07b..09cd9778871 100644 --- a/src/include/commands/tablecmds.h +++ b/src/include/commands/tablecmds.h @@ -106,17 +106,17 @@ extern bool PartConstraintImpliedByRelConstraint(Relation scanrel, List *partConstraint); typedef void (*InvokePreDropColumnHook_type) (Relation rel, AttrNumber attnum); -extern PGDLLEXPORT InvokePreDropColumnHook_type InvokePreDropColumnHook; +extern PGDLLIMPORT InvokePreDropColumnHook_type InvokePreDropColumnHook; typedef void (*InvokePreAddConstraintsHook_type) (Relation rel, ParseState *pstate, List *newColDefaults); -extern PGDLLEXPORT InvokePreAddConstraintsHook_type InvokePreAddConstraintsHook; +extern PGDLLIMPORT InvokePreAddConstraintsHook_type InvokePreAddConstraintsHook; typedef bool (*check_extended_attoptions_hook_type) (Node *options); -extern PGDLLEXPORT check_extended_attoptions_hook_type check_extended_attoptions_hook; +extern check_extended_attoptions_hook_type check_extended_attoptions_hook; typedef int (*find_attr_by_name_from_column_def_list_hook_type) ( const char *attributeName, List *schema); -extern PGDLLEXPORT find_attr_by_name_from_column_def_list_hook_type +extern PGDLLIMPORT find_attr_by_name_from_column_def_list_hook_type find_attr_by_name_from_column_def_list_hook; #endif /* TABLECMDS_H */ diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h index b0346bf9de6..b69e1966462 100644 --- a/src/include/commands/trigger.h +++ b/src/include/commands/trigger.h @@ -312,12 +312,12 @@ extern void RI_PartitionRemove_Check(Trigger *trigger, Relation fk_rel, extern int RI_FKey_trigger_type(Oid tgfoid); -extern PGDLLEXPORT void BeginCompositeTriggers(MemoryContext curCxt); -extern PGDLLEXPORT void EndCompositeTriggers(bool error); +extern void BeginCompositeTriggers(MemoryContext curCxt); +extern void EndCompositeTriggers(bool error); extern bool TsqlRecuresiveCheck(ResultRelInfo *resultRelInfo); typedef bool (*check_pltsql_support_tsql_transactions_hook_type) (void); -extern PGDLLEXPORT check_pltsql_support_tsql_transactions_hook_type check_pltsql_support_tsql_transactions_hook; +extern PGDLLIMPORT check_pltsql_support_tsql_transactions_hook_type check_pltsql_support_tsql_transactions_hook; #endif /* TRIGGER_H */ diff --git a/src/include/commands/typecmds.h b/src/include/commands/typecmds.h index 2fda12ede98..67b15a1981a 100644 --- a/src/include/commands/typecmds.h +++ b/src/include/commands/typecmds.h @@ -61,6 +61,6 @@ extern ObjectAddress AlterType(AlterTypeStmt *stmt); extern bool enable_domain_typmod; typedef Oid (*define_type_default_collation_hook_type)(Oid); -extern PGDLLEXPORT define_type_default_collation_hook_type define_type_default_collation_hook; +extern PGDLLIMPORT define_type_default_collation_hook_type define_type_default_collation_hook; #endif /* TYPECMDS_H */ diff --git a/src/include/commands/view.h b/src/include/commands/view.h index 248aaf82094..0d101721860 100644 --- a/src/include/commands/view.h +++ b/src/include/commands/view.h @@ -23,8 +23,8 @@ extern ObjectAddress DefineView(ViewStmt *stmt, const char *queryString, extern void StoreViewQuery(Oid viewOid, Query *viewParse, bool replace); typedef void (*store_view_definition_hook_type) (const char *queryString, ObjectAddress address); -extern PGDLLEXPORT store_view_definition_hook_type store_view_definition_hook; +extern PGDLLIMPORT store_view_definition_hook_type store_view_definition_hook; typedef void (*inherit_view_constraints_from_table_hook_type) (ColumnDef *col, Oid tableOid, AttrNumber colId); -extern PGDLLEXPORT inherit_view_constraints_from_table_hook_type inherit_view_constraints_from_table_hook; +extern PGDLLIMPORT inherit_view_constraints_from_table_hook_type inherit_view_constraints_from_table_hook; #endif /* VIEW_H */ diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 35ab4852cbd..1e957ff9bcf 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -73,22 +73,22 @@ /* Hook for plugins to get control in ExecutorStart() */ typedef void (*ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags); -extern PGDLLEXPORT ExecutorStart_hook_type ExecutorStart_hook; +extern PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook; /* Hook for plugins to get control in ExecutorRun() */ typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once); -extern PGDLLEXPORT ExecutorRun_hook_type ExecutorRun_hook; +extern PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook; /* Hook for plugins to get control in ExecutorFinish() */ typedef void (*ExecutorFinish_hook_type) (QueryDesc *queryDesc); -extern PGDLLEXPORT ExecutorFinish_hook_type ExecutorFinish_hook; +extern PGDLLIMPORT ExecutorFinish_hook_type ExecutorFinish_hook; /* Hook for plugins to get control in ExecutorEnd() */ typedef void (*ExecutorEnd_hook_type) (QueryDesc *queryDesc); -extern PGDLLEXPORT ExecutorEnd_hook_type ExecutorEnd_hook; +extern PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook; /* Hook for plugins to get control in ExecCheckPermissions() */ typedef bool (*ExecutorCheckPerms_hook_type) (List *rangeTable, @@ -97,13 +97,13 @@ typedef bool (*ExecutorCheckPerms_hook_type) (List *rangeTable, extern PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook; typedef bool (*TriggerRecuresiveCheck_hook_type) (ResultRelInfo *resultRelInfo); -extern PGDLLEXPORT TriggerRecuresiveCheck_hook_type TriggerRecuresiveCheck_hook; +extern PGDLLIMPORT TriggerRecuresiveCheck_hook_type TriggerRecuresiveCheck_hook; typedef bool (*bbfViewHasInsteadofTrigger_hook_type) (Relation view, CmdType event); extern PGDLLIMPORT bbfViewHasInsteadofTrigger_hook_type bbfViewHasInsteadofTrigger_hook; typedef bool (*check_rowcount_hook_type) (int es_processed); -extern PGDLLEXPORT check_rowcount_hook_type check_rowcount_hook; +extern PGDLLIMPORT check_rowcount_hook_type check_rowcount_hook; /* * prototypes from functions in execAmi.c diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h index 2459065e4b3..41afa7c5d2d 100644 --- a/src/include/executor/spi.h +++ b/src/include/executor/spi.h @@ -194,7 +194,7 @@ extern void SPI_cursor_fetch(Portal portal, bool forward, long count); extern void SPI_cursor_move(Portal portal, bool forward, long count); extern void SPI_scroll_cursor_fetch(Portal, FetchDirection direction, long count); extern void SPI_scroll_cursor_move(Portal, FetchDirection direction, long count); -extern PGDLLEXPORT void SPI_scroll_cursor_fetch_dest(Portal portal, FetchDirection direction, +extern void SPI_scroll_cursor_fetch_dest(Portal portal, FetchDirection direction, long count, DestReceiver *receiver); extern void SPI_cursor_close(Portal portal); @@ -212,5 +212,5 @@ extern void AtEOXact_SPI(bool isCommit); extern void AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid); extern bool SPI_inside_nonatomic_context(void); -extern PGDLLEXPORT void SPI_setCurrentInternalTxnMode(bool mode); +extern void SPI_setCurrentInternalTxnMode(bool mode); #endif /* SPI_H */ diff --git a/src/include/fmgr.h b/src/include/fmgr.h index acf4a28a7c2..0aec3ddb214 100644 --- a/src/include/fmgr.h +++ b/src/include/fmgr.h @@ -802,8 +802,8 @@ extern set_local_schema_for_func_hook_type set_local_schema_for_func_hook; extern PGDLLIMPORT needs_fmgr_hook_type needs_fmgr_hook; extern PGDLLIMPORT fmgr_hook_type fmgr_hook; -extern PGDLLEXPORT non_tsql_proc_entry_hook_type non_tsql_proc_entry_hook; -extern PGDLLEXPORT get_func_language_oids_hook_type get_func_language_oids_hook; +extern PGDLLIMPORT non_tsql_proc_entry_hook_type non_tsql_proc_entry_hook; +extern PGDLLIMPORT get_func_language_oids_hook_type get_func_language_oids_hook; #define FmgrHookIsNeeded(fn_oid) \ (!needs_fmgr_hook ? false : (*needs_fmgr_hook)(fn_oid)) diff --git a/src/include/funcapi.h b/src/include/funcapi.h index ab0ea2c0512..887edd34baf 100644 --- a/src/include/funcapi.h +++ b/src/include/funcapi.h @@ -359,7 +359,7 @@ extern int extract_variadic_args(FunctionCallInfo fcinfo, int variadic_start, typedef void (*modify_RangeTblFunction_tupdesc_hook_type) ( char *funcname, Node *expr, TupleDesc *tupdesc); -extern PGDLLEXPORT modify_RangeTblFunction_tupdesc_hook_type +extern PGDLLIMPORT modify_RangeTblFunction_tupdesc_hook_type modify_RangeTblFunction_tupdesc_hook; #endif /* FUNCAPI_H */ diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 0e33fd3c400..5c733427942 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -489,7 +489,7 @@ extern void TouchSocketLockFiles(void); extern void AddToDataDirLockFile(int target_line, const char *str); extern bool RecheckDataDirLockFile(void); extern void ValidatePgVersion(const char *path); -extern PGDLLEXPORT void load_libraries(const char *libraries, const char *gucname, bool restricted); +extern void load_libraries(const char *libraries, const char *gucname, bool restricted); extern void process_shared_preload_libraries(void); extern void process_session_preload_libraries(void); extern void process_shmem_requests(void); @@ -497,7 +497,7 @@ extern void pg_bindtextdomain(const char *domain); extern bool has_rolreplication(Oid roleid); typedef void (*shmem_request_hook_type) (void); -extern PGDLLEXPORT shmem_request_hook_type shmem_request_hook; +extern PGDLLIMPORT shmem_request_hook_type shmem_request_hook; extern Size EstimateClientConnectionInfoSpace(void); extern void SerializeClientConnectionInfo(Size maxsize, char *start_address); diff --git a/src/include/nodes/nodeFuncs.h b/src/include/nodes/nodeFuncs.h index f42d5f05cdc..e14c2b3fe19 100644 --- a/src/include/nodes/nodeFuncs.h +++ b/src/include/nodes/nodeFuncs.h @@ -220,6 +220,6 @@ extern bool planstate_tree_walker_impl(struct PlanState *planstate, void *context); typedef int32 (*coalesce_typmod_hook_type) (const CoalesceExpr *cexpr); -extern PGDLLEXPORT coalesce_typmod_hook_type coalesce_typmod_hook; +extern PGDLLIMPORT coalesce_typmod_hook_type coalesce_typmod_hook; #endif /* NODEFUNCS_H */ diff --git a/src/include/nodes/value.h b/src/include/nodes/value.h index 861d5fafee5..daf4166e961 100644 --- a/src/include/nodes/value.h +++ b/src/include/nodes/value.h @@ -94,6 +94,6 @@ extern Float *makeFloat(char *numericStr); extern Boolean *makeBoolean(bool val); extern String *makeString(char *str); extern BitString *makeBitString(char *str); -extern PGDLLEXPORT TSQL_HexString *makeTSQLHexString(char *str); +extern TSQL_HexString *makeTSQLHexString(char *str); #endif /* VALUE_H */ diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h index 4bdcfa0bcde..d631ea0e6a1 100644 --- a/src/include/optimizer/clauses.h +++ b/src/include/optimizer/clauses.h @@ -57,9 +57,9 @@ extern Query *inline_set_returning_function(PlannerInfo *root, extern Bitmapset *pull_paramids(Expr *expr); typedef void (*insert_pltsql_function_defaults_hook_type)(HeapTuple func_tuple, List *defaults, Node **argarray); -extern PGDLLEXPORT insert_pltsql_function_defaults_hook_type insert_pltsql_function_defaults_hook; +extern PGDLLIMPORT insert_pltsql_function_defaults_hook_type insert_pltsql_function_defaults_hook; typedef List* (*replace_pltsql_function_defaults_hook_type)(HeapTuple func_tuple, List *defaults, List *fargs); -extern PGDLLEXPORT replace_pltsql_function_defaults_hook_type replace_pltsql_function_defaults_hook; +extern PGDLLIMPORT replace_pltsql_function_defaults_hook_type replace_pltsql_function_defaults_hook; #endif /* CLAUSES_H */ diff --git a/src/include/optimizer/planner.h b/src/include/optimizer/planner.h index 01df901b053..2393e46b452 100644 --- a/src/include/optimizer/planner.h +++ b/src/include/optimizer/planner.h @@ -27,13 +27,13 @@ typedef PlannedStmt *(*planner_hook_type) (Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams); -extern PGDLLEXPORT planner_hook_type planner_hook; +extern PGDLLIMPORT planner_hook_type planner_hook; /* Hook for plugins to transform qual nodes in planner */ typedef Node* (*planner_node_transformer_hook_type) (PlannerInfo *root, Node *expr, int kind); -extern PGDLLEXPORT planner_node_transformer_hook_type planner_node_transformer_hook; +extern PGDLLIMPORT planner_node_transformer_hook_type planner_node_transformer_hook; /* Hook for plugins to get control when grouping_planner() plans upper rels */ typedef void (*create_upper_paths_hook_type) (PlannerInfo *root, diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h index 2a54e302fd4..73d671245ac 100644 --- a/src/include/parser/analyze.h +++ b/src/include/parser/analyze.h @@ -22,51 +22,51 @@ typedef void (*post_parse_analyze_hook_type) (ParseState *pstate, Query *query, JumbleState *jstate); -extern PGDLLEXPORT post_parse_analyze_hook_type post_parse_analyze_hook; +extern PGDLLIMPORT post_parse_analyze_hook_type post_parse_analyze_hook; /* Hook for plugins to get control with the raw parse tree */ typedef void (*pre_parse_analyze_hook_type) (ParseState *pstate, RawStmt *parseTree); -extern PGDLLEXPORT pre_parse_analyze_hook_type pre_parse_analyze_hook; +extern PGDLLIMPORT pre_parse_analyze_hook_type pre_parse_analyze_hook; /* Hook to handle qualifiers in returning list for output clause */ typedef void (*pre_transform_returning_hook_type) (Query *query, List *returningList, ParseState *pstate); -extern PGDLLEXPORT pre_transform_returning_hook_type pre_transform_returning_hook; +extern PGDLLIMPORT pre_transform_returning_hook_type pre_transform_returning_hook; typedef void (*post_transform_delete_hook_type) (ParseState *pstate, DeleteStmt *stmt, Query *query); -extern PGDLLEXPORT post_transform_delete_hook_type post_transform_delete_hook; +extern PGDLLIMPORT post_transform_delete_hook_type post_transform_delete_hook; /* Hook to modify insert statement in output clause */ typedef void (*pre_transform_insert_hook_type) (ParseState *pstate, InsertStmt *stmt, Query *query); -extern PGDLLEXPORT pre_transform_insert_hook_type pre_transform_insert_hook; +extern PGDLLIMPORT pre_transform_insert_hook_type pre_transform_insert_hook; /* Hook to perform self-join transformation on UpdateStmt in output clause */ typedef Node* (*pre_output_clause_transformation_hook_type) (ParseState *pstate, UpdateStmt *stmt, Query *query); -extern PGDLLEXPORT pre_output_clause_transformation_hook_type pre_output_clause_transformation_hook; +extern PGDLLIMPORT pre_output_clause_transformation_hook_type pre_output_clause_transformation_hook; /* Hook to read a global variable with info on output clause */ typedef bool (*get_output_clause_status_hook_type) (void); -extern PGDLLEXPORT get_output_clause_status_hook_type get_output_clause_status_hook; +extern PGDLLIMPORT get_output_clause_status_hook_type get_output_clause_status_hook; /* Hook for plugins to get control after an insert row transform */ typedef void (*post_transform_insert_row_hook_type) (List *icolumns, List *exprList, Oid relid); -extern PGDLLEXPORT post_transform_insert_row_hook_type post_transform_insert_row_hook; +extern PGDLLIMPORT post_transform_insert_row_hook_type post_transform_insert_row_hook; /* Hook for handle target table before transforming from clause */ typedef int (*set_target_table_alternative_hook_type) (ParseState *pstate, Node *stmt, CmdType command); -extern PGDLLEXPORT set_target_table_alternative_hook_type set_target_table_alternative_hook; +extern PGDLLIMPORT set_target_table_alternative_hook_type set_target_table_alternative_hook; /* Hook for handle target table before transforming from clause */ typedef void (*pre_transform_setop_tree_hook_type) (SelectStmt *stmt, SelectStmt *leftmostSelect); -extern PGDLLEXPORT pre_transform_setop_tree_hook_type pre_transform_setop_tree_hook; +extern PGDLLIMPORT pre_transform_setop_tree_hook_type pre_transform_setop_tree_hook; /* Hook for handle target table before transforming from clause */ typedef void (*pre_transform_setop_sort_clause_hook_type) (ParseState *pstate, Query *qry, List *sortClause, Query *leftmostQuery); -extern PGDLLEXPORT pre_transform_setop_sort_clause_hook_type pre_transform_setop_sort_clause_hook; +extern PGDLLIMPORT pre_transform_setop_sort_clause_hook_type pre_transform_setop_sort_clause_hook; /* Hook for transform pivot clause in tsql select stmt */ typedef void (*transform_pivot_clause_hook_type)(ParseState *pstate, SelectStmt *stmt); -extern PGDLLEXPORT transform_pivot_clause_hook_type transform_pivot_clause_hook; +extern PGDLLIMPORT transform_pivot_clause_hook_type transform_pivot_clause_hook; extern Query *parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv); diff --git a/src/include/parser/parse_clause.h b/src/include/parser/parse_clause.h index 30902cf5034..9eefe1236d1 100644 --- a/src/include/parser/parse_clause.h +++ b/src/include/parser/parse_clause.h @@ -52,12 +52,12 @@ extern Index assignSortGroupRef(TargetEntry *tle, List *tlist); extern bool targetIsInSortList(TargetEntry *tle, Oid sortop, List *sortList); typedef bool (*tle_name_comparison_hook_type)(const char *tlename, const char *identifier); -extern PGDLLEXPORT tle_name_comparison_hook_type tle_name_comparison_hook; +extern PGDLLIMPORT tle_name_comparison_hook_type tle_name_comparison_hook; typedef void (*sortby_nulls_hook_type)(SortGroupClause *sortcl, bool reverse); -extern PGDLLEXPORT sortby_nulls_hook_type sortby_nulls_hook; +extern PGDLLIMPORT sortby_nulls_hook_type sortby_nulls_hook; typedef Node* (*optimize_explicit_cast_hook_type)(ParseState *pstate, Node *node); -extern PGDLLEXPORT optimize_explicit_cast_hook_type optimize_explicit_cast_hook; +extern PGDLLIMPORT optimize_explicit_cast_hook_type optimize_explicit_cast_hook; #endif /* PARSE_CLAUSE_H */ diff --git a/src/include/parser/parse_coerce.h b/src/include/parser/parse_coerce.h index a134cdc9178..cd920c13334 100644 --- a/src/include/parser/parse_coerce.h +++ b/src/include/parser/parse_coerce.h @@ -132,7 +132,7 @@ typedef Node *(*coerce_string_literal_hook_type) (ParseCallbackState *pcbstate, typedef void (*validate_implicit_conversion_from_string_literal_hook_type) (Const *newcon, const char *value); typedef Oid (*select_common_type_hook_type) (ParseState *pstate, List *exprs, const char *context, Node **which_expr); -extern PGDLLEXPORT select_common_type_hook_type select_common_type_hook; +extern PGDLLIMPORT select_common_type_hook_type select_common_type_hook; typedef int32 (*select_common_typmod_hook_type) (ParseState *pstate, List *exprs, Oid common_type); #endif /* PARSE_COERCE_H */ diff --git a/src/include/parser/parse_collate.h b/src/include/parser/parse_collate.h index 0101bc97b09..d0fdf0e3fbf 100644 --- a/src/include/parser/parse_collate.h +++ b/src/include/parser/parse_collate.h @@ -25,6 +25,6 @@ extern void assign_expr_collations(ParseState *pstate, Node *expr); extern Oid select_common_collation(ParseState *pstate, List *exprs, bool none_ok); typedef bool (*avoid_collation_override_hook_type)(Oid funcid); -extern PGDLLEXPORT avoid_collation_override_hook_type avoid_collation_override_hook; +extern PGDLLIMPORT avoid_collation_override_hook_type avoid_collation_override_hook; #endif /* PARSE_COLLATE_H */ diff --git a/src/include/parser/parse_expr.h b/src/include/parser/parse_expr.h index f1df4d95181..cfe55dfa785 100644 --- a/src/include/parser/parse_expr.h +++ b/src/include/parser/parse_expr.h @@ -24,6 +24,6 @@ extern const char *ParseExprKindName(ParseExprKind exprKind); /* Hook for finding parameter definition */ typedef Node * (*lookup_param_hook_type)(ParseState *pstate, ColumnRef *cref); -extern PGDLLEXPORT lookup_param_hook_type lookup_param_hook; +extern PGDLLIMPORT lookup_param_hook_type lookup_param_hook; #endif /* PARSE_EXPR_H */ diff --git a/src/include/parser/parse_func.h b/src/include/parser/parse_func.h index f302d0de4c8..a56a765d9ac 100644 --- a/src/include/parser/parse_func.h +++ b/src/include/parser/parse_func.h @@ -77,8 +77,8 @@ extern void check_srf_call_placement(ParseState *pstate, Node *last_srf, typedef FuncCandidateList (*func_select_candidate_hook_type) (int nargs, Oid *input_typeids, FuncCandidateList candidates, bool unknowns_resolved); /* Hook interface to process function arguments using probin */ typedef void (*make_fn_arguments_from_stored_proc_probin_hook_type)(ParseState *pstate,List *fargs,Oid *actual_arg_types,Oid *declared_arg_types,Oid funcid); -extern PGDLLEXPORT make_fn_arguments_from_stored_proc_probin_hook_type make_fn_arguments_from_stored_proc_probin_hook; +extern PGDLLIMPORT make_fn_arguments_from_stored_proc_probin_hook_type make_fn_arguments_from_stored_proc_probin_hook; typedef void (*report_proc_not_found_error_hook_type) (List *names, List *argnames, int nargs, ParseState *pstate, int location, bool proc_call); -extern PGDLLEXPORT report_proc_not_found_error_hook_type report_proc_not_found_error_hook; +extern PGDLLIMPORT report_proc_not_found_error_hook_type report_proc_not_found_error_hook; #endif /* PARSE_FUNC_H */ diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h index b0bae180750..7b9f2015d9f 100644 --- a/src/include/parser/parse_relation.h +++ b/src/include/parser/parse_relation.h @@ -128,7 +128,7 @@ extern bool isQueryUsingTempRelation(Query *query); typedef int (*find_attr_by_name_from_relation_hook_type) ( Relation rd, const char *attname, bool sysColOK); -extern PGDLLEXPORT find_attr_by_name_from_relation_hook_type +extern PGDLLIMPORT find_attr_by_name_from_relation_hook_type find_attr_by_name_from_relation_hook; #endif /* PARSE_RELATION_H */ diff --git a/src/include/parser/parse_target.h b/src/include/parser/parse_target.h index 248dcc31403..96108353000 100644 --- a/src/include/parser/parse_target.h +++ b/src/include/parser/parse_target.h @@ -56,12 +56,12 @@ extern char *FigureColname(Node *node); extern char *FigureIndexColname(Node *node); typedef void (*pre_transform_target_entry_hook_type)(ResTarget *res, ParseState *pstate, ParseExprKind exprKind); -extern PGDLLEXPORT pre_transform_target_entry_hook_type pre_transform_target_entry_hook; +extern PGDLLIMPORT pre_transform_target_entry_hook_type pre_transform_target_entry_hook; typedef void (*resolve_target_list_unknowns_hook_type)(ParseState *pstate, List *targetlist); -extern PGDLLEXPORT resolve_target_list_unknowns_hook_type resolve_target_list_unknowns_hook; +extern PGDLLIMPORT resolve_target_list_unknowns_hook_type resolve_target_list_unknowns_hook; typedef void (*handle_type_and_collation_hook_type)(Node *node, Oid typeid, Oid collationid); -extern PGDLLEXPORT handle_type_and_collation_hook_type handle_type_and_collation_hook; +extern PGDLLIMPORT handle_type_and_collation_hook_type handle_type_and_collation_hook; #endif /* PARSE_TARGET_H */ diff --git a/src/include/parser/parse_type.h b/src/include/parser/parse_type.h index ea441bccd1d..f519be3db4e 100644 --- a/src/include/parser/parse_type.h +++ b/src/include/parser/parse_type.h @@ -60,13 +60,13 @@ extern bool parseTypeString(const char *str, Oid *typeid_p, int32 *typmod_p, /* Hook to check/setup default typmod for sys.(N)(VAR)CHAR datatypes. */ typedef void (*check_or_set_default_typmod_hook_type)(TypeName * typeName, int32 *typmod, bool is_cast); -extern PGDLLEXPORT check_or_set_default_typmod_hook_type check_or_set_default_typmod_hook; +extern PGDLLIMPORT check_or_set_default_typmod_hook_type check_or_set_default_typmod_hook; /* * Hook to check whether variable length datatypes like numeric, decimal, time, datetime2, datetimeoffset * are declared with permissible datalength at the time of table or stored procedure creation */ typedef void (*validate_var_datatype_scale_hook_type)(const TypeName *typeName, Type typ); -extern PGDLLEXPORT validate_var_datatype_scale_hook_type validate_var_datatype_scale_hook; +extern PGDLLIMPORT validate_var_datatype_scale_hook_type validate_var_datatype_scale_hook; #endif /* PARSE_TYPE_H */ diff --git a/src/include/parser/parse_utilcmd.h b/src/include/parser/parse_utilcmd.h index 59409ba2b2d..73975920900 100644 --- a/src/include/parser/parse_utilcmd.h +++ b/src/include/parser/parse_utilcmd.h @@ -22,11 +22,11 @@ struct AttrMap; /* avoid including attmap.h here */ /* IDENTITY datatype hook */ typedef void (*pltsql_identity_datatype_hook_type) (ParseState *pstate, ColumnDef *column); -extern PGDLLEXPORT pltsql_identity_datatype_hook_type pltsql_identity_datatype_hook; +extern PGDLLIMPORT pltsql_identity_datatype_hook_type pltsql_identity_datatype_hook; typedef void (*post_transform_column_definition_hook_type) (ParseState *pstate, RangeVar* relation, ColumnDef *column, List **alist); typedef void (*post_transform_table_definition_hook_type) (ParseState *pstate, RangeVar* relation, char *relname, List **alist); -extern PGDLLEXPORT post_transform_column_definition_hook_type post_transform_column_definition_hook; -extern PGDLLEXPORT post_transform_table_definition_hook_type post_transform_table_definition_hook; +extern PGDLLIMPORT post_transform_column_definition_hook_type post_transform_column_definition_hook; +extern PGDLLIMPORT post_transform_table_definition_hook_type post_transform_table_definition_hook; extern List *transformCreateStmt(CreateStmt *stmt, const char *queryString); extern AlterTableStmt *transformAlterTableStmt(Oid relid, AlterTableStmt *stmt, diff --git a/src/include/parser/parser.h b/src/include/parser/parser.h index 7db986b9eec..40a0825cd18 100644 --- a/src/include/parser/parser.h +++ b/src/include/parser/parser.h @@ -74,9 +74,7 @@ extern PGDLLIMPORT int backslash_quote; extern PGDLLIMPORT bool escape_string_warning; extern PGDLLIMPORT bool standard_conforming_strings; extern PGDLLEXPORT int sql_dialect; -extern PGDLLEXPORT bool pltsql_case_insensitive_identifiers; - -extern PGDLLEXPORT char* pltsql_server_collation_name; +extern bool pltsql_case_insensitive_identifiers; /* Primary entry point for the raw parsing functions */ extern List *raw_parser(const char *str, RawParseMode mode); @@ -88,20 +86,20 @@ extern TypeName *SystemTypeName(char *name); /* Hook to extend backend parser */ typedef List * (*raw_parser_hook_type) (const char *str, RawParseMode mode); -extern PGDLLEXPORT raw_parser_hook_type raw_parser_hook; +extern PGDLLIMPORT raw_parser_hook_type raw_parser_hook; /* Hooks needed in grammar rule in gram.y */ typedef List * (*rewrite_typmod_expr_hook_type) (List *expr_list); -extern PGDLLEXPORT rewrite_typmod_expr_hook_type rewrite_typmod_expr_hook; +extern PGDLLIMPORT rewrite_typmod_expr_hook_type rewrite_typmod_expr_hook; typedef void (*validate_numeric_typmods_hook_type) (List **typmods, bool isNumeric, void* yyscanner); -extern PGDLLEXPORT validate_numeric_typmods_hook_type validate_numeric_typmods_hook; +extern PGDLLIMPORT validate_numeric_typmods_hook_type validate_numeric_typmods_hook; typedef bool (*check_recursive_cte_hook_type) (WithClause *with_clause); -extern PGDLLEXPORT check_recursive_cte_hook_type check_recursive_cte_hook; +extern PGDLLIMPORT check_recursive_cte_hook_type check_recursive_cte_hook; typedef void (*fix_domain_typmods_hook_type) (TypeName *typname); -extern PGDLLEXPORT fix_domain_typmods_hook_type fix_domain_typmods_hook; +extern PGDLLIMPORT fix_domain_typmods_hook_type fix_domain_typmods_hook; #define TSQLMaxTypmod -8000 #define TSQLMaxNumPrecision 38 diff --git a/src/include/parser/scansup.h b/src/include/parser/scansup.h index f709ca0682c..81d805ff6d5 100644 --- a/src/include/parser/scansup.h +++ b/src/include/parser/scansup.h @@ -25,6 +25,6 @@ extern void truncate_identifier(char *ident, int len, bool warn); extern bool scanner_isspace(char ch); typedef bool (*truncate_identifier_hook_type)(char *ident, int len, bool warn); -extern PGDLLEXPORT truncate_identifier_hook_type truncate_identifier_hook; +extern PGDLLIMPORT truncate_identifier_hook_type truncate_identifier_hook; #endif /* SCANSUP_H */ diff --git a/src/include/pgstat.h b/src/include/pgstat.h index a140fa37a11..1976ea7c0c6 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -788,15 +788,15 @@ extern void pg_stat_write_backend_details_NoAlloc(int outfile, PgBackendStatus * extern void write_structdef_file(void); typedef void (*pre_function_call_hook_type) (const char *funcName); -extern PGDLLEXPORT pre_function_call_hook_type pre_function_call_hook; +extern PGDLLIMPORT pre_function_call_hook_type pre_function_call_hook; typedef void (*invalidate_stat_table_hook_type) (void); -extern PGDLLEXPORT invalidate_stat_table_hook_type invalidate_stat_table_hook; +extern PGDLLIMPORT invalidate_stat_table_hook_type invalidate_stat_table_hook; typedef bool (*tsql_has_pgstat_permissions_hook_type) (Oid role); -extern PGDLLEXPORT tsql_has_pgstat_permissions_hook_type tsql_has_pgstat_permissions_hook; +extern PGDLLIMPORT tsql_has_pgstat_permissions_hook_type tsql_has_pgstat_permissions_hook; typedef void (*pgstat_function_wrapper_hook_type)(FunctionCallInfo, PgStat_FunctionCallUsage *, char *); -extern PGDLLEXPORT pgstat_function_wrapper_hook_type pgstat_function_wrapper_hook; +extern PGDLLIMPORT pgstat_function_wrapper_hook_type pgstat_function_wrapper_hook; #endif /* PGSTAT_H */ diff --git a/src/include/postmaster/protocol_extension.h b/src/include/postmaster/protocol_extension.h index 45cb33833aa..d486935c207 100644 --- a/src/include/postmaster/protocol_extension.h +++ b/src/include/postmaster/protocol_extension.h @@ -21,11 +21,11 @@ typedef void (*listen_init_hook_type)(void); /* Globals in postmaster.c */ -extern PGDLLEXPORT listen_init_hook_type listen_init_hook; +extern listen_init_hook_type listen_init_hook; /* Functions in postmaster.c */ -extern PGDLLEXPORT int listen_have_free_slot(void); -extern PGDLLEXPORT void listen_add_socket(pgsocket fd, +extern int listen_have_free_slot(void); +extern void listen_add_socket(pgsocket fd, ProtocolExtensionConfig *protocol_config); extern int libpq_accept(pgsocket server_fd, Port *port); diff --git a/src/include/replication/logical.h b/src/include/replication/logical.h index 5eca9606949..992ce8fe2fd 100644 --- a/src/include/replication/logical.h +++ b/src/include/replication/logical.h @@ -148,6 +148,6 @@ extern void ResetLogicalStreamingState(void); extern void UpdateDecodingStats(LogicalDecodingContext *ctx); typedef void (*logicalrep_modify_slot_hook_type)(Relation rel, EState *estate, TupleTableSlot *slot); -extern PGDLLEXPORT logicalrep_modify_slot_hook_type logicalrep_modify_slot_hook; +extern PGDLLIMPORT logicalrep_modify_slot_hook_type logicalrep_modify_slot_hook; #endif diff --git a/src/include/storage/ipc.h b/src/include/storage/ipc.h index 2bbcff0c75d..888c08b3067 100644 --- a/src/include/storage/ipc.h +++ b/src/include/storage/ipc.h @@ -75,7 +75,7 @@ extern void on_exit_reset(void); extern void check_on_shmem_exit_lists_are_empty(void); /* ipci.c */ -extern PGDLLEXPORT shmem_startup_hook_type shmem_startup_hook; +extern PGDLLIMPORT shmem_startup_hook_type shmem_startup_hook; extern Size CalculateShmemSize(int *num_semaphores); extern void CreateSharedMemoryAndSemaphores(void); diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h index 332f1b42811..c16451c6861 100644 --- a/src/include/storage/lock.h +++ b/src/include/storage/lock.h @@ -545,7 +545,7 @@ typedef enum /* TSQL-only handler for releasing application lock. */ typedef void (*applock_release_func_handler_type) (bool release_session); -extern PGDLLEXPORT applock_release_func_handler_type applock_release_func_handler; +extern applock_release_func_handler_type applock_release_func_handler; /* * function prototypes diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h index 70302f2c7c9..b74ef5ad467 100644 --- a/src/include/tcop/tcopprot.h +++ b/src/include/tcop/tcopprot.h @@ -86,7 +86,7 @@ extern long get_stack_depth_rlimit(void); extern void ResetUsage(void); extern void ShowUsage(const char *title); extern int check_log_duration(char *msec_str, bool was_logged); -extern PGDLLEXPORT bool check_log_statement(List *stmt); +extern bool check_log_statement(List *stmt); extern void set_debug_options(int debug_flag, GucContext context, GucSource source); extern bool set_plan_disabling_options(const char *arg, diff --git a/src/include/tcop/utility.h b/src/include/tcop/utility.h index fa5c444a901..f92dc156baf 100644 --- a/src/include/tcop/utility.h +++ b/src/include/tcop/utility.h @@ -75,7 +75,7 @@ typedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc); -extern PGDLLEXPORT ProcessUtility_hook_type ProcessUtility_hook; +extern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook; extern void ProcessUtility(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, @@ -110,9 +110,9 @@ extern LogStmtLevel GetCommandLogLevel(Node *parsetree); extern bool CommandIsReadOnly(PlannedStmt *pstmt); typedef bool (*bbfCustomProcessUtility_hook_type)(struct ParseState *pstate, PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryCompletion *qc); -extern PGDLLEXPORT bbfCustomProcessUtility_hook_type bbfCustomProcessUtility_hook; +extern PGDLLIMPORT bbfCustomProcessUtility_hook_type bbfCustomProcessUtility_hook; typedef void (*bbfSelectIntoUtility_hook_type)(struct ParseState *pstate, PlannedStmt *pstmt, const char *queryString, QueryEnvironment *queryEnv, ParamListInfo params, QueryCompletion *qc); -extern PGDLLEXPORT bbfSelectIntoUtility_hook_type bbfSelectIntoUtility_hook; +extern PGDLLIMPORT bbfSelectIntoUtility_hook_type bbfSelectIntoUtility_hook; #endif /* UTILITY_H */ diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h index e3196271180..434abc2924a 100644 --- a/src/include/utils/acl.h +++ b/src/include/utils/acl.h @@ -276,9 +276,9 @@ extern bool has_createrole_privilege(Oid roleid); extern bool has_bypassrls_privilege(Oid roleid); typedef bool (*tsql_has_linked_srv_permissions_hook_type) (Oid roleid); -extern PGDLLEXPORT tsql_has_linked_srv_permissions_hook_type tsql_has_linked_srv_permissions_hook; +extern PGDLLIMPORT tsql_has_linked_srv_permissions_hook_type tsql_has_linked_srv_permissions_hook; typedef Oid (*bbf_get_sysadmin_oid_hook_type) (void); -extern PGDLLEXPORT bbf_get_sysadmin_oid_hook_type bbf_get_sysadmin_oid_hook; +extern PGDLLIMPORT bbf_get_sysadmin_oid_hook_type bbf_get_sysadmin_oid_hook; #endif /* ACL_H */ diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 3932bf87c45..ac455d8a544 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -36,7 +36,6 @@ extern uint64 hex_encode(const char *src, size_t len, char *dst); extern uint64 hex_decode(const char *src, size_t len, char *dst); extern uint64 hex_decode_safe(const char *src, size_t len, char *dst, Node *escontext); -extern PGDLLEXPORT uint64 hex_decode_allow_odd_digits(const char *src, unsigned len, char *dst); /* int.c */ extern int2vector *buildint2vector(const int16 *int2s, int n); @@ -136,10 +135,10 @@ extern char *quote_literal_cstr(const char *rawstr); /* varchar.c */ typedef bool (*suppress_string_truncation_error_hook_type)(); -extern PGDLLEXPORT suppress_string_truncation_error_hook_type suppress_string_truncation_error_hook; +extern PGDLLIMPORT suppress_string_truncation_error_hook_type suppress_string_truncation_error_hook; /* name.c */ typedef Name (*cstr_to_name_hook_type)(char *s, int len); -extern PGDLLEXPORT cstr_to_name_hook_type cstr_to_name_hook; +extern PGDLLIMPORT cstr_to_name_hook_type cstr_to_name_hook; #endif /* BUILTINS_H */ diff --git a/src/include/utils/guc_hooks.h b/src/include/utils/guc_hooks.h index 738ba6682ff..8110e48fabb 100644 --- a/src/include/utils/guc_hooks.h +++ b/src/include/utils/guc_hooks.h @@ -165,6 +165,6 @@ extern void assign_xlog_sync_method(int new_sync_method, void *extra); /* Babelfish-specific hook for updating GUCs */ typedef void (*guc_newval_hook_type) (const char *guc, bool boolVal, const char *strVal, int intVal); -extern PGDLLEXPORT guc_newval_hook_type guc_newval_hook; +extern PGDLLIMPORT guc_newval_hook_type guc_newval_hook; #endif /* GUC_HOOKS_H */ diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h index 47eaaa1d162..5fa3b382a92 100644 --- a/src/include/utils/guc_tables.h +++ b/src/include/utils/guc_tables.h @@ -326,8 +326,8 @@ extern void guc_set_stack_value(struct config_generic *gconf, config_var_value * typedef void (*guc_push_old_value_hook_type) (struct config_generic *gconf, GucAction action); -extern PGDLLEXPORT guc_push_old_value_hook_type guc_push_old_value_hook; +extern PGDLLIMPORT guc_push_old_value_hook_type guc_push_old_value_hook; typedef void(*validate_set_config_function_hook_type) (char *name, char *value); -extern PGDLLEXPORT validate_set_config_function_hook_type validate_set_config_function_hook; +extern PGDLLIMPORT validate_set_config_function_hook_type validate_set_config_function_hook; #endif /* GUC_TABLES_H */ diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h index 4e80b87601f..fdd40d44c0e 100644 --- a/src/include/utils/numeric.h +++ b/src/include/utils/numeric.h @@ -112,6 +112,6 @@ extern Datum bigint_poly_aggr_final(FunctionCallInfo fcinfo, tsqlAggType aggType /* Hook interface to calculate exact numeric digits before generating numeric overflow error in TSQL */ typedef bool (*detect_numeric_overflow_hook_type) (int weight, int dscale, int first_block, int numeric_base); -extern PGDLLEXPORT detect_numeric_overflow_hook_type detect_numeric_overflow_hook; +extern PGDLLIMPORT detect_numeric_overflow_hook_type detect_numeric_overflow_hook; #endif /* _PG_NUMERIC_H_ */ diff --git a/src/include/utils/pg_locale.h b/src/include/utils/pg_locale.h index 4f4560fcd99..a6a9e7a82d4 100644 --- a/src/include/utils/pg_locale.h +++ b/src/include/utils/pg_locale.h @@ -135,6 +135,6 @@ extern size_t char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen, pg_locale_t locale); typedef pg_locale_t* (*collation_cache_entry_hook_type)(Oid, pg_locale_t *); -extern PGDLLEXPORT collation_cache_entry_hook_type collation_cache_entry_hook; +extern PGDLLIMPORT collation_cache_entry_hook_type collation_cache_entry_hook; #endif /* _PG_LOCALE_ */ diff --git a/src/include/utils/plancache.h b/src/include/utils/plancache.h index 8b7d4550f62..71b41aad72a 100644 --- a/src/include/utils/plancache.h +++ b/src/include/utils/plancache.h @@ -186,10 +186,10 @@ typedef struct CachedExpression } CachedExpression; typedef void (*plansource_complete_hook_type) (CachedPlanSource *plansource); -extern PGDLLEXPORT plansource_complete_hook_type plansource_complete_hook; +extern PGDLLIMPORT plansource_complete_hook_type plansource_complete_hook; typedef bool (*plansource_revalidate_hook_type) (CachedPlanSource *plansource); -extern PGDLLEXPORT plansource_revalidate_hook_type plansource_revalidate_hook; +extern PGDLLIMPORT plansource_revalidate_hook_type plansource_revalidate_hook; extern void InitPlanCache(void); extern void ResetPlanCache(void); diff --git a/src/include/utils/queryenvironment.h b/src/include/utils/queryenvironment.h index fffe276bcc9..3a1e142f47f 100644 --- a/src/include/utils/queryenvironment.h +++ b/src/include/utils/queryenvironment.h @@ -90,20 +90,20 @@ extern struct QueryEnvironment *currentQueryEnv; extern struct QueryEnvironment *topLevelQueryEnv; extern QueryEnvironment *create_queryEnv(void); -extern PGDLLEXPORT QueryEnvironment *create_queryEnv2(MemoryContext cxt, bool top_level); -extern PGDLLEXPORT void remove_queryEnv(void); +extern QueryEnvironment *create_queryEnv2(MemoryContext cxt, bool top_level); +extern void remove_queryEnv(void); extern EphemeralNamedRelationMetadata get_visible_ENR_metadata(QueryEnvironment *queryEnv, const char *refname); extern void register_ENR(QueryEnvironment *queryEnv, EphemeralNamedRelation enr); extern void unregister_ENR(QueryEnvironment *queryEnv, const char *name); -extern PGDLLEXPORT List *get_namedRelList(void); +extern List *get_namedRelList(void); extern EphemeralNamedRelation get_ENR(QueryEnvironment *queryEnv, const char *name); -extern PGDLLEXPORT EphemeralNamedRelation get_ENR_withoid(QueryEnvironment *queryEnv, Oid oid, EphemeralNameRelationType type); +extern EphemeralNamedRelation get_ENR_withoid(QueryEnvironment *queryEnv, Oid oid, EphemeralNameRelationType type); extern TupleDesc ENRMetadataGetTupDesc(EphemeralNamedRelationMetadata enrmd); extern bool ENRaddTuple(Relation rel, HeapTuple tup); extern bool ENRdropTuple(Relation rel, HeapTuple tup); extern bool ENRupdateTuple(Relation rel, HeapTuple tup); extern bool ENRgetSystableScan(Relation rel, Oid indexoid, int nkeys, ScanKey key, List **tuplist, int *tuplist_i, int *tuplist_flags); -extern PGDLLEXPORT void ENRDropTempTables(QueryEnvironment *queryEnv); +extern void ENRDropTempTables(QueryEnvironment *queryEnv); extern void ENRDropEntry(Oid id); extern void ENRDropCatalogEntry(Relation catalog_relation, Oid relid); extern bool has_existing_enr_relations(void); diff --git a/src/include/utils/ruleutils.h b/src/include/utils/ruleutils.h index a4993bed87b..ea7ebe5f7d1 100644 --- a/src/include/utils/ruleutils.h +++ b/src/include/utils/ruleutils.h @@ -53,6 +53,6 @@ typedef int (*print_pltsql_function_arguments_hook_type) (StringInfo buf, HeapTuple proctup, bool print_table_args, bool print_defaults); -extern PGDLLEXPORT print_pltsql_function_arguments_hook_type print_pltsql_function_arguments_hook; +extern PGDLLIMPORT print_pltsql_function_arguments_hook_type print_pltsql_function_arguments_hook; #endif /* RULEUTILS_H */