--- a/c++/include/corelib/impl/ncbi_atomic_defs.h
+++ b/c++/include/corelib/impl/ncbi_atomic_defs.h
@@ -117,7 +117,7 @@
    ((defined(__i386) || defined(__sparc) || defined(__x86_64))  &&  \
     !defined(__GLIBCPP__) /* < 3.0 or >= 3.4 */)  &&  \
    (!defined(__GLIBCXX__)  ||  !defined(NCBI_TCHECK)))
-#  if defined(__x86_64)
+#  if defined(__x86_64)  &&  !defined(_ILP32)
 #    define NCBI_COUNTER_64_BIT
 #  endif
 #  ifdef NCBI_COUNTER_64_BIT
