Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1997
  6. //
  7. // File: rtrlib.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _RTRLIB_H
  11. #define _RTRLIB_H
  12. //----------------------------------------------------------------------------
  13. // Macro: DWORD_CMP
  14. //
  15. // Performs a 'safe' comparison of two 32-bit DWORDs, using subtraction.
  16. // The values are first shifted right to clear the sign-bit, and then
  17. // if the resulting values are equal, the difference between the lowest bits
  18. // is returned.
  19. //----------------------------------------------------------------------------
  20. //#define DWORD_CMP(a,b,c) \
  21. // (((c) = (((a)>>1) - ((b)>>1))) ? (c) : ((c) = (((a)&1) - ((b)&1))))
  22. inline int DWORD_CMP(DWORD a, DWORD b)
  23. {
  24. DWORD t = ((a >> 1) - (b >> 1));
  25. return t ? t : ((a & 1) - (b & 1));
  26. }
  27. HRESULT AddRoutingProtocol(IRtrMgrInfo *pRm, IRtrMgrProtocolInfo *pRmProt, HWND hWnd);
  28. #endif // _RTRLIB_H