Change W32 console detection to look at the window, not stdout
[platform/upstream/glib.git] / glib / gmem.h
index 8795b67..5dcc3f8 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -119,13 +117,12 @@ gpointer g_try_realloc_n  (gpointer        mem,
     /* This assignment is needed to avoid a gcc warning */                     \
     GDestroyNotify _destroy = (GDestroyNotify) (destroy);                      \
                                                                                \
-    (void) (0 ? (gpointer) *(pp) : 0);                                         \
-    do                                                                         \
-      _p = g_atomic_pointer_get (_pp);                                         \
-    while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_pp, _p, NULL)); \
-                                                                               \
-    if (_p)                                                                    \
-      _destroy (_p);                                                           \
+    _p = *_pp;                                                                 \
+    if (_p)                                                                   \
+      {                                                                       \
+        *_pp = NULL;                                                          \
+        _destroy (_p);                                                         \
+      }                                                                        \
   } G_STMT_END
 
 /* Optimise: avoid the call to the (slower) _n function if we can