|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.269 2008/11/13 09:45:24 mha Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.270 2008/11/14 22:58:51 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="libpq">
|
4 | 4 | <title><application>libpq</application> - C Library</title>
|
@@ -5255,6 +5255,19 @@ int eventproc(PGEventId evtId, void *evtInfo, void *passThrough)
|
5255 | 5255 | <structname>PGconn</>. This is because the address of the procedure
|
5256 | 5256 | is used as a lookup key to identify the associated instance data.
|
5257 | 5257 | </para>
|
| 5258 | + |
| 5259 | + <caution> |
| 5260 | + <para> |
| 5261 | + On Windows, functions can have two different addresses: one visible |
| 5262 | + from outside a DLL and another visible from inside the DLL. One |
| 5263 | + should be careful that only one of these addresses is used with |
| 5264 | + <application>libpq</>'s event-procedure functions, else confusion will |
| 5265 | + result. The simplest rule for writing code that will work is to |
| 5266 | + ensure that event procedures are declared <literal>static</>. If the |
| 5267 | + procedure's address must be available outside its own source file, |
| 5268 | + expose a separate function to return the address. |
| 5269 | + </para> |
| 5270 | + </caution> |
5258 | 5271 | </listitem>
|
5259 | 5272 | </varlistentry>
|
5260 | 5273 | </variablelist>
|
|