Re: problem with msvc linker - cannot build orafce
От | Craig Ringer |
---|---|
Тема | Re: problem with msvc linker - cannot build orafce |
Дата | |
Msg-id | CAMsr+YG2kBeLcG-1g67KCtKryuuE+5ERoN0rAYAYRNHNWW8LvQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: problem with msvc linker - cannot build orafce (Craig Ringer <craig@2ndquadrant.com>) |
Ответы |
Re: problem with msvc linker - cannot build orafce
|
Список | pgsql-hackers |
I don't think that's necessary, per above. You just have to access the vars via pointer indirection always, so long as *any* Pg version you support has ever lacked dllexport or DEF entry, so you can't dllimport the var.You could enable direct dllimport if PG_VERSION_NUM shows you're on a new enough version, but you'd need to use conditionally compiled inlines or something to switch between the methods of accessing it, so there's not much point. You just declareextern int* log_min_messages_p;... and use that, probably also #define'ing log_min_messages away after including the Pg headers so that you can't reference it accidentally.
#if PG_VERSION_NUM < 90405
extern int* log_min_messages_p;
#define log_min_messages (*log_min_messages_p)
#endif
after including all PostgreSQL headers. It won't work for inline functions defined in PostgreSQL headers, but should otherwise be OK I think.
(again, untested)
В списке pgsql-hackers по дате отправления: