当前位置: 首页>>代码示例>>C++>>正文


C++ ACE_NOTSUP_RETURN函数代码示例

本文整理汇总了C++中ACE_NOTSUP_RETURN函数的典型用法代码示例。如果您正苦于以下问题:C++ ACE_NOTSUP_RETURN函数的具体用法?C++ ACE_NOTSUP_RETURN怎么用?C++ ACE_NOTSUP_RETURN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ACE_NOTSUP_RETURN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: defined

int
ACE_OS::sprintf (wchar_t *buf, const wchar_t *format, ...)
{
  // ACE_OS_TRACE ("ACE_OS::sprintf");
#if defined (ACE_LACKS_VA_FUNCTIONS)
  ACE_UNUSED_ARG (buf);
  ACE_UNUSED_ARG (format);
  ACE_NOTSUP_RETURN (-1);
#else
  va_list ap;
  va_start (ap, format);
  int const result = ACE_OS::vsprintf (buf, format, ap);
  va_end (ap);
  return result;
#endif /* ACE_LACKS_VA_FUNCTIONS */
}
开发者ID:binary42,项目名称:OCI,代码行数:16,代码来源:OS_NS_stdio.cpp

示例2: ACE_TRACE

// purge_pending_notifications
// Removes all entries from the notify_queue_ and each one that
// matches <eh> is put on the free_queue_. The rest are saved on a
// local queue and copied back to the notify_queue_ at the end.
// Returns the number of entries removed. Returns -1 on error.
// ACE_NOTSUP_RETURN if ACE_HAS_REACTOR_NOTIFICATION_QUEUE is not defined.
int
ACE_Select_Reactor_Notify::purge_pending_notifications (ACE_Event_Handler *eh,
                                                        ACE_Reactor_Mask  mask )
{
  ACE_TRACE ("ACE_Select_Reactor_Notify::purge_pending_notifications");

#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE)

  return notification_queue_.purge_pending_notifications(eh, mask);

#else /* defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) */
  ACE_UNUSED_ARG (eh);
  ACE_UNUSED_ARG (mask);
  ACE_NOTSUP_RETURN (-1);
#endif  /* defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) */
}
开发者ID:Desch,项目名称:MythCore,代码行数:22,代码来源:Select_Reactor_Base.cpp

示例3: ACE_TRACE

int
ACE_INET_Addr::set (const char port_name[],
                    ACE_UINT32 inet_address,
                    const char protocol[])
{
  ACE_TRACE ("ACE_INET_Addr::set");

  int const port_number = get_port_number_from_name (port_name, protocol);
  if (port_number == -1)
    {
      ACE_NOTSUP_RETURN (-1);
    }

  return this->set (static_cast<u_short> (port_number),
                    inet_address, 0);
}
开发者ID:Akenyshka,项目名称:MythCore,代码行数:16,代码来源:INET_Addr.cpp

示例4: ACE_UNUSED_ARG

int
ACE_SSL_Context::egd_file (const char * socket_file)
{
#if OPENSSL_VERSION_NUMBER < 0x00905100L
    // OpenSSL < 0.9.5 doesn't have EGD support.
    ACE_UNUSED_ARG (socket_file);
    ACE_NOTSUP_RETURN (-1);
#else
    // RAND_egd() returns the amount of entropy used to seed the random
    // number generator.  The actual value should be greater than 16,
    // i.e. 128 bits.
    if (::RAND_egd (socket_file) > 0)
        return 0;
    else
        return -1;
#endif  /* OPENSSL_VERSION_NUMBER >= 0x00905100L */
}
开发者ID:kanbang,项目名称:Colt,代码行数:17,代码来源:SSL_Context.cpp

示例5: defined

int
ACE_Event_Handler::remove_stdin_handler (ACE_Reactor *reactor,
                                         ACE_Thread_Manager *thr_mgr)
{
#if defined (ACE_WIN32)
  ACE_UNUSED_ARG (reactor);
  ACE_UNUSED_ARG (thr_mgr);

  // What should we do here?
  ACE_NOTSUP_RETURN (-1);
#else
  // Keep compilers happy.
  ACE_UNUSED_ARG (thr_mgr);
  return reactor->remove_handler (ACE_STDIN,
                                  ACE_Event_Handler::READ_MASK);
#endif /* ACE_WIN32 */
}
开发者ID:jonathlela,项目名称:vast,代码行数:17,代码来源:Event_Handler.cpp

示例6: ACE_OS_TRACE

long
ACE_OS::num_processors (void)
{
  ACE_OS_TRACE ("ACE_OS::num_processors");

#if defined (ACE_HAS_PHARLAP)
  return 1;
#elif defined (ACE_WIN32) || defined (ACE_WIN64)
  SYSTEM_INFO sys_info;
  ::GetSystemInfo (&sys_info);
  return sys_info.dwNumberOfProcessors;
#elif defined (linux) || defined (sun)
  return ::sysconf (_SC_NPROCESSORS_CONF);
#else
  ACE_NOTSUP_RETURN (-1);
#endif
}
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:17,代码来源:OS_NS_unistd.cpp

示例7: ACE_OS_TRACE

FILE *
ACE_OS::fopen (const wchar_t *filename,
               const ACE_TCHAR *mode)
{
  ACE_OS_TRACE ("ACE_OS::fopen");
#if defined (ACE_LACKS_FOPEN)
  ACE_UNUSED_ARG (filename);
  ACE_UNUSED_ARG (mode);
  ACE_NOTSUP_RETURN (0);
#else
  int hmode = _O_TEXT;

  for (const ACE_TCHAR *mode_ptr = mode; *mode_ptr != 0; mode_ptr++)
    fopen_mode_to_open_mode_converter (*mode_ptr, hmode);

  ACE_HANDLE handle = ACE_OS::open (filename, hmode);
  if (handle != ACE_INVALID_HANDLE)
    {
      hmode &= _O_TEXT | _O_RDONLY | _O_APPEND;

      int const fd = ::_open_osfhandle (intptr_t (handle), hmode);

      if (fd != -1)
        {
#   if defined (ACE_HAS_NONCONST_FDOPEN) && !defined (ACE_USES_WCHAR)
          FILE *fp = ::_fdopen (fd, const_cast<char *> (mode));
#   elif defined (ACE_HAS_NONCONST_FDOPEN) && defined (ACE_USES_WCHAR)
          FILE *fp = ::_wfdopen (fd, const_cast<wchar_t *> (mode));
#   elif defined (ACE_USES_WCHAR)
          FILE *fp = ::_wfdopen (fd, mode);
#   else
          FILE *fp = ::fdopen (fd, mode);
#   endif /* defined(ACE_HAS_NONCONST_FDOPEN) && !defined (ACE_USES_WCHAR)) */
          if (fp != 0)
          {
            return fp;
          }
          ::_close (fd);
        }

      ACE_OS::close (handle);
    }
  return 0;
#endif
}
开发者ID:binary42,项目名称:OCI,代码行数:45,代码来源:OS_NS_stdio.cpp

示例8: defined

int
ACE_Sched_Params::previous_priority (const Policy policy,
                                     const int priority,
                                     const int scope)
{
#if defined (ACE_HAS_WTHREADS)
  ACE_UNUSED_ARG (policy);
  ACE_UNUSED_ARG (scope);
  switch (priority)
    {
      case THREAD_PRIORITY_IDLE:
        return THREAD_PRIORITY_IDLE;
      case THREAD_PRIORITY_LOWEST:
        return THREAD_PRIORITY_IDLE;
      case THREAD_PRIORITY_BELOW_NORMAL:
        return THREAD_PRIORITY_LOWEST;
      case THREAD_PRIORITY_NORMAL:
        return THREAD_PRIORITY_BELOW_NORMAL;
      case THREAD_PRIORITY_ABOVE_NORMAL:
        return THREAD_PRIORITY_NORMAL;
      case THREAD_PRIORITY_HIGHEST:
        return THREAD_PRIORITY_ABOVE_NORMAL;
      case THREAD_PRIORITY_TIME_CRITICAL:
        return THREAD_PRIORITY_HIGHEST;
      default:
        return priority;  // unknown priority:  should never get here
    }
#elif defined(ACE_HAS_THREADS) && \
      (!defined(ACE_LACKS_SETSCHED) || defined (ACE_TANDEM_T1248_PTHREADS) || \
       defined (ACE_HAS_PTHREAD_SCHEDPARAM))
  // including STHREADS and PTHREADS
  int const min = priority_min (policy, scope);

  return priority > min ? priority - 1 : min;
#elif defined (ACE_VXWORKS)
  return priority < priority_min (policy, scope)
           ?  priority + 1
           :  priority_min (policy, scope);
#else
  ACE_UNUSED_ARG (policy);
  ACE_UNUSED_ARG (scope);
  ACE_UNUSED_ARG (priority);
  ACE_NOTSUP_RETURN (-1);
#endif /* ACE_HAS_THREADS */
}
开发者ID:Denominator13,项目名称:NeoCore,代码行数:45,代码来源:Sched_Params.cpp

示例9: ACE_UNUSED_ARG

int
ACE_Shared_Memory_Pool::find_seg (const void* const searchPtr,
                                  ACE_OFF_T &offset,
                                  size_t &counter)
{
#ifndef ACE_HAS_SYSV_IPC
  ACE_UNUSED_ARG (searchPtr);
  ACE_UNUSED_ARG (offset);
  ACE_UNUSED_ARG (counter);
  ACE_NOTSUP_RETURN (-1);
#else
  offset = 0;
  SHM_TABLE *st = reinterpret_cast<SHM_TABLE *> (this->base_addr_);
  shmid_ds buf;

  for (counter = 0;
       counter < this->max_segments_
         && st[counter].used_ == 1;
       counter++)
    {
      if (ACE_OS::shmctl (st[counter].shmid_, IPC_STAT, &buf) == -1)
        ACELIB_ERROR_RETURN ((LM_ERROR,
                           ACE_TEXT ("(%P|%t) %p\n"),
                           ACE_TEXT ("shmctl")),
                          -1);
      offset += buf.shm_segsz;

      // If segment 'counter' starts at a location greater than the
      // place we are searching for. We then decrement the offset to
      // the start of counter-1. ([email protected])
      if (((ptrdiff_t) offset + (ptrdiff_t) (this->base_addr_)) > (ptrdiff_t) searchPtr)
        {
          --counter;
          offset -= buf.shm_segsz;
          return 0;
        }
      // ACELIB_DEBUG ((LM_DEBUG,  ACE_TEXT ("(%P|%t) segment size = %d, offset = %d\n"), buf.shm_segsz, offset));
    }

  return 0;
#endif
}
开发者ID:binary42,项目名称:OCI,代码行数:42,代码来源:Shared_Memory_Pool.cpp

示例10: ACE_TRACE

int
ACE_SSL_SOCK::disable (int value) const
{
  ACE_TRACE("ACE_SSL_SOCK::disable");
  switch (value)
    {
#ifdef SIGURG
    case SIGURG:
    case ACE_SIGURG:
#endif  /* SIGURG */
    case SIGIO:
    case ACE_SIGIO:
    case ACE_CLOEXEC:
      ACE_NOTSUP_RETURN (-1);
    case ACE_NONBLOCK:
      return ACE_IPC_SAP::disable (value);
    default:
      return -1;
    }
}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:20,代码来源:SSL_SOCK.cpp

示例11: ACE_OS_TRACE

pid_t
ACE_OS::fork (const ACE_TCHAR *program_name)
{
  ACE_OS_TRACE ("ACE_OS::fork");
# if defined (ACE_LACKS_FORK)
  ACE_UNUSED_ARG (program_name);
  ACE_NOTSUP_RETURN (pid_t (-1));
# else
  pid_t const pid =
# if defined (ACE_HAS_STHREADS)
    ::fork1 ();
#else
    ::fork ();
#endif /* ACE_HAS_STHREADS */

#if !defined (ACE_HAS_MINIMAL_ACE_OS) && !defined (ACE_HAS_THREADS)

  // ACE_Base_Thread_Adapter::sync_log_msg() is used to update the
  // program name and process id in ACE's log framework.  However, we
  // can't invoke it from (the child process of) threaded programs
  // because it calls async signal unsafe functions, which will result
  // in undefined behavior (only async signal safe functions can be
  // called after fork() until an exec()).
  //
  // This is no great loss.  Using the ACE log framework in the child
  // process will undoubtedly call async signal unsafe functions too.
  // So it doesn't really matter that the program name and process id
  // will not be updated.

  if (pid == 0)
    ACE_Base_Thread_Adapter::sync_log_msg (program_name);

#else

  ACE_UNUSED_ARG (program_name);

#endif /* ! ACE_HAS_MINIMAL_ACE_OS && !ACE_HAS_THREADS */

  return pid;
# endif /* ACE_WIN32 */
}
开发者ID:16898500,项目名称:SkyFireEMU,代码行数:41,代码来源:OS_NS_unistd.cpp

示例12: defined

int Socket::enable (int value) const
{
#if defined (ACE_WIN32)
  switch (value)
    {
    case ACE_NONBLOCK:
      {
        // nonblocking argument (1)
        // blocking:            (0)
        int nonblock = 1;
        return OS::ioctl (this->m_handle,
                              FIONBIO,
                              &nonblock);
      }
    default:
      ACE_NOTSUP_RETURN (-1);
    }
#else  /* ! ACE_WIN32 && ! VXWORKS */
  switch (value)
    {

#if defined (F_SETFD)
    case ACE_CLOEXEC:
      // Enables the close-on-exec flag.
      if (OS::fcntl (this->m_handle,
                         F_SETFD,
                         1) == -1)
        return -1;
      break;
#endif /* F_SETFD */
    case ACE_NONBLOCK:
      if (ACE::set_flags (this->m_handle, ACE_NONBLOCK) == ACE_INVALID_HANDLE)
        return -1;
      break;
    default:
      return -1;
    }
  return 0;
#endif /* ! ACE_WIN32 */
}
开发者ID:wuhua988,项目名称:icm,代码行数:40,代码来源:Socket.cpp

示例13: defined

// Cause the specified handle to be passed to a child process
// when it's spawned.
int
ACE_Process_Options::pass_handle (ACE_HANDLE h)
{
# if defined (ACE_WIN32)
#  if defined (ACE_HAS_WINCE)
  ACE_NOTSUP_RETURN (-1);
#  else

  // This is oriented towards socket handles... may need some adjustment
  // for non-sockets.
  // This is all based on an MSDN article:
  // http://support.microsoft.com/support/kb/articles/Q150/5/23.asp
  // If on Win95/98, the handle needs to be duplicated for the to-be-spawned
  // process. On WinNT, they get inherited by the child process automatically.
  // If the handle is duplicated, remember the duplicate so it can be
  // closed later. Can't be closed now, or the child won't get it.
  ACE_TEXT_OSVERSIONINFO osvi;
  ZeroMemory (&osvi, sizeof (osvi));
  osvi.dwOSVersionInfoSize = sizeof (ACE_TEXT_OSVERSIONINFO);
  // If this is Win95/98 or we can't tell, duplicate the handle.
  if (!ACE_TEXT_GetVersionEx (&osvi) || osvi.dwPlatformId != VER_PLATFORM_WIN32_NT)
    {
      HANDLE dup_handle;
      if (!DuplicateHandle (GetCurrentProcess (),
                            static_cast<HANDLE> (h),
                            GetCurrentProcess (),
                            &dup_handle,
                            0,
                            TRUE,   // Inheritable
                            DUPLICATE_SAME_ACCESS))
        return -1;
      dup_handles_.set_bit (static_cast<ACE_HANDLE> (dup_handle));
    }
#  endif /* ACE_HAS_WINCE */
#endif /* ACE_WIN32 */

  this->handles_passed_.set_bit (h);

  return 0;
}
开发者ID:Bootz,项目名称:SkyFire_one,代码行数:42,代码来源:Process.cpp

示例14: ACE_OS_TRACE

long
ACE_OS::num_processors_online (void)
{
  ACE_OS_TRACE ("ACE_OS::num_processors_online");

#if defined (ACE_HAS_PHARLAP)
  return 1;
#elif defined (ACE_WIN32)
  SYSTEM_INFO sys_info;
  ::GetSystemInfo (&sys_info);
  long active_processors = 0;
  DWORD_PTR mask = sys_info.dwActiveProcessorMask;
  while (mask != 0)
    {
      if (mask & 1)
        ++active_processors;
      mask >>= 1;
    }
  return active_processors;
#elif defined (_SC_NPROCESSORS_ONLN)
  return ::sysconf (_SC_NPROCESSORS_ONLN);
#elif defined (ACE_HAS_SYSCTL)
  int num_processors;
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof (num_processors);
  if (::sysctl (mib, 2, &num_processors, &len, 0, 0) != -1)
    return num_processors;
  else
    return -1;
#elif defined (__hpux)
  struct pst_dynamic psd;
  if (::pstat_getdynamic (&psd, sizeof (psd), (size_t) 1, 0) != -1)
    return psd.psd_proc_cnt;
  else
    return -1;
#else
  ACE_NOTSUP_RETURN (-1);
#endif
}
开发者ID:Denominator13,项目名称:NeoCore,代码行数:39,代码来源:OS_NS_unistd.cpp

示例15: ACE_OS_TRACE

pid_t
ACE_OS::fork (const ACE_TCHAR *program_name)
{
  ACE_OS_TRACE ("ACE_OS::fork");
# if defined (ACE_LACKS_FORK)
  ACE_UNUSED_ARG (program_name);
  ACE_NOTSUP_RETURN (pid_t (-1));
# else
  pid_t pid =
# if defined (ACE_HAS_STHREADS)
    ::fork1 ();
#else
    ::fork ();
#endif /* ACE_HAS_STHREADS */

#if !defined (ACE_HAS_MINIMAL_ACE_OS)
  if (pid == 0)
    ACE_Base_Thread_Adapter::sync_log_msg (program_name);
#endif /* ! ACE_HAS_MINIMAL_ACE_OS */

  return pid;
# endif /* ACE_WIN32 */
}
开发者ID:jonathlela,项目名称:vast,代码行数:23,代码来源:OS_NS_unistd.cpp


注:本文中的ACE_NOTSUP_RETURN函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。