mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-10-31 15:57:31 +03:00 
			
		
		
		
	Micrsoft Visual C Compile Fix
Moved the declarations of variables/pointers to the beginning of the block, where MSVC wants them.
This commit is contained in:
		
							parent
							
								
									e286970b62
								
							
						
					
					
						commit
						1f1133b871
					
				|  | @ -56,6 +56,8 @@ extern HIDDEN PyObject *pyPsycopgTzLOCAL; | ||||||
| static PyObject * | static PyObject * | ||||||
| pydatetime_str(pydatetimeObject *self) | pydatetime_str(pydatetimeObject *self) | ||||||
| { | { | ||||||
|  |     PyObject *res = NULL; | ||||||
|  |     PyObject *iso; | ||||||
|     if (self->type <= PSYCO_DATETIME_TIMESTAMP) { |     if (self->type <= PSYCO_DATETIME_TIMESTAMP) { | ||||||
|         PyObject *tz; |         PyObject *tz; | ||||||
| 
 | 
 | ||||||
|  | @ -76,8 +78,7 @@ pydatetime_str(pydatetimeObject *self) | ||||||
|             break; |             break; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         PyObject *res = NULL; |         iso = PyObject_CallMethod(self->wrapped, "isoformat", NULL); | ||||||
|         PyObject *iso = PyObject_CallMethod(self->wrapped, "isoformat", NULL); |  | ||||||
|         if (iso) { |         if (iso) { | ||||||
|             res = PyString_FromFormat(fmt, PyString_AsString(iso)); |             res = PyString_FromFormat(fmt, PyString_AsString(iso)); | ||||||
|             Py_DECREF(iso); |             Py_DECREF(iso); | ||||||
|  |  | ||||||
|  | @ -256,6 +256,7 @@ int | ||||||
| conn_setup(connectionObject *self, PGconn *pgconn) | conn_setup(connectionObject *self, PGconn *pgconn) | ||||||
| { | { | ||||||
|     PGresult *pgres; |     PGresult *pgres; | ||||||
|  |     int green; | ||||||
| 
 | 
 | ||||||
|     self->equote = conn_get_standard_conforming_strings(pgconn); |     self->equote = conn_get_standard_conforming_strings(pgconn); | ||||||
|     self->server_version = conn_get_server_version(pgconn); |     self->server_version = conn_get_server_version(pgconn); | ||||||
|  | @ -265,7 +266,7 @@ conn_setup(connectionObject *self, PGconn *pgconn) | ||||||
|     pthread_mutex_lock(&self->lock); |     pthread_mutex_lock(&self->lock); | ||||||
|     Py_BLOCK_THREADS; |     Py_BLOCK_THREADS; | ||||||
| 
 | 
 | ||||||
|     int green = psyco_green(); |     green = psyco_green(); | ||||||
| 
 | 
 | ||||||
|     if (green && (pq_set_non_blocking(self, 1, 1) != 0)) { |     if (green && (pq_set_non_blocking(self, 1, 1) != 0)) { | ||||||
|         return -1; |         return -1; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user