pyldb: protect PyErr_LDB_ERROR_IS_ERR_RAISE() with do {} while(0)
[samba.git] / lib / ldb / pyldb.h
index e0cce1e89d229c722fbb1f8793039d743d6134e2..4fc89ec48142ee13941fedd66004bf4fa35533f6 100644 (file)
@@ -95,11 +95,12 @@ typedef struct {
        struct ldb_control *data;
 } PyLdbControlObject;
 
-#define PyErr_LDB_ERROR_IS_ERR_RAISE(err,ret,ldb) \
+#define PyErr_LDB_ERROR_IS_ERR_RAISE(err,ret,ldb) do { \
        if (ret != LDB_SUCCESS) { \
                PyErr_SetLdbError(err, ret, ldb); \
                return NULL; \
-       }
+       } \
+} while(0)
 
 /* Picked out of thin air. To do this properly, we should probably have some part of the 
  * errors in LDB be allocated to bindings ? */