Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Mar 2015 15:37:56 +0000 (UTC)
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r381342 - head/security/libtomcrypt/files
Message-ID:  <201503151537.t2FFbu2E018123@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: antoine
Date: Sun Mar 15 15:37:55 2015
New Revision: 381342
URL: https://svnweb.freebsd.org/changeset/ports/381342
QAT: https://qat.redports.org/buildarchive/r381342/

Log:
  Allow building with clang 3.6
  
  PR:		198017
  Submitted by:	dim

Added:
  head/security/libtomcrypt/files/
  head/security/libtomcrypt/files/patch-src_headers_tomcrypt__macros.h   (contents, props changed)

Added: head/security/libtomcrypt/files/patch-src_headers_tomcrypt__macros.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/libtomcrypt/files/patch-src_headers_tomcrypt__macros.h	Sun Mar 15 15:37:55 2015	(r381342)
@@ -0,0 +1,104 @@
+--- src/headers/tomcrypt_macros.h.orig	2007-05-12 14:46:25 UTC
++++ src/headers/tomcrypt_macros.h
+@@ -262,21 +262,19 @@ static inline unsigned ROR(unsigned word
+ 
+ #ifndef LTC_NO_ROLC
+ 
+-static inline unsigned ROLc(unsigned word, const int i)
+-{
+-   asm ("roll %2,%0"
+-      :"=r" (word)
+-      :"0" (word),"I" (i));
+-   return word;
+-}
++#define ROLc(word, i) ({     \
++   unsigned _word = word;    \
++   asm ("roll %2,%0"         \
++      :"=r" (_word)          \
++      :"0" (_word),"I" (i)); \
++   _word; })
+ 
+-static inline unsigned RORc(unsigned word, const int i)
+-{
+-   asm ("rorl %2,%0"
+-      :"=r" (word)
+-      :"0" (word),"I" (i));
+-   return word;
+-}
++#define RORc(word, i) ({     \
++   unsigned _word = word;    \
++   asm ("rorl %2,%0"         \
++      :"=r" (_word)          \
++      :"0" (_word),"I" (i)); \
++   _word; })
+ 
+ #else
+ 
+@@ -305,21 +303,19 @@ static inline unsigned ROR(unsigned word
+ 
+ #ifndef LTC_NO_ROLC
+ 
+-static inline unsigned ROLc(unsigned word, const int i)
+-{
+-   asm ("rotlwi %0,%0,%2"
+-      :"=r" (word)
+-      :"0" (word),"I" (i));
+-   return word;
+-}
++#define ROLc(word, i) ({     \
++   unsigned _word = word;    \
++   asm ("rotlwi %0,%0,%2"    \
++      :"=r" (_word)          \
++      :"0" (_word),"I" (i)); \
++   _word; })
+ 
+-static inline unsigned RORc(unsigned word, const int i)
+-{
+-   asm ("rotrwi %0,%0,%2"
+-      :"=r" (word)
+-      :"0" (word),"I" (i));
+-   return word;
+-}
++#define RORc(word, i) ({     \
++   unsigned _word = word;    \
++   asm ("rotrwi %0,%0,%2"    \
++      :"=r" (_word)          \
++      :"0" (_word),"I" (i)); \
++   _word; })
+ 
+ #else
+ 
+@@ -361,21 +357,19 @@ static inline unsigned long ROR64(unsign
+ 
+ #ifndef LTC_NO_ROLC
+ 
+-static inline unsigned long ROL64c(unsigned long word, const int i)
+-{
+-   asm("rolq %2,%0"
+-      :"=r" (word)
+-      :"0" (word),"J" (i));
+-   return word;
+-}
++#define ROL64c(word, i) ({     \
++   unsigned long _word = word; \
++   asm ("rolq %2,%0"           \
++      :"=r" (_word)            \
++      :"0" (_word),"J" (i));   \
++   _word; })
+ 
+-static inline unsigned long ROR64c(unsigned long word, const int i)
+-{
+-   asm("rorq %2,%0"
+-      :"=r" (word)
+-      :"0" (word),"J" (i));
+-   return word;
+-}
++#define ROR64c(word, i) ({     \
++   unsigned long _word = word; \
++   asm ("rorq %2,%0"           \
++      :"=r" (_word)            \
++      :"0" (_word),"J" (i));   \
++   _word; })
+ 
+ #else /* LTC_NO_ROLC */
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503151537.t2FFbu2E018123>