summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/px.h
diff options
context:
space:
mode:
authorBruce Momjian2001-11-29 19:40:37 +0000
committerBruce Momjian2001-11-29 19:40:37 +0000
commit8aa538cfd5a2bcdfc54aced86c7c17b502742fc6 (patch)
tree8846d6eaad62039e8f9c933305e8ce4ed5b493d1 /contrib/pgcrypto/px.h
parent0556f7ca87035e8974495dc6ec530794ace7782c (diff)
* When postgres.h does not define BYTE_ENDIAN pgcrypto
produces garbage. I learned the hard way that #if UNDEFINED_1 == UNDEFINED_2 #error "gcc is idiot" #endif prints "gcc is idiot" ... Affected are MD5/SHA1 in internal library, and also HMAC-MD5/HMAC-SHA1/ crypt-md5 which use them. Blowfish is ok, also Rijndael on at least x86. Big thanks to Daniel Holtzman who send me a build log which contained warning: md5.c:246: warning: `X' defined but not used Yes, gcc is that helpful... Please apply this. -- marko
Diffstat (limited to 'contrib/pgcrypto/px.h')
-rw-r--r--contrib/pgcrypto/px.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/pgcrypto/px.h b/contrib/pgcrypto/px.h
index 9cfa86d8b7d..570dadf9198 100644
--- a/contrib/pgcrypto/px.h
+++ b/contrib/pgcrypto/px.h
@@ -26,12 +26,21 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: px.h,v 1.5 2001/11/20 15:50:53 momjian Exp $
+ * $Id: px.h,v 1.6 2001/11/29 19:40:37 momjian Exp $
*/
#ifndef __PX_H
#define __PX_H
+#ifdef HAVE_ENDIAN_H
+#include <endian.h>
+#endif
+
+#ifndef BYTE_ORDER
+#error BYTE_ORDER must be defined as LITTLE_ENDIAN or BIG_ENDIAN
+#endif
+
+
#if 1
#define px_alloc(s) palloc(s)