Re: Syntax errors in crypto.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well, I did some experimenting. I changed
OSSL_CRYPTO_ALLOC void *CRYPTO_malloc(size_t num, const char *file, int line);

to

void *CRYPTO_malloc(size_t num, const char *file, int line);

And it compiled. I tried changing the OSSL_CRYPTO_ALLOC define to define it as blank. But that still gets a syntax
error saying it expects a ";" before the "void *". That seems odd to me.


Don Payette
(cell) 479-216-6320


On Tue, Aug 15, 2023 at 9:01 AM Don Payette <payettedon@xxxxxxxxx> wrote:
I'm converting an existing Winsock app to have encryption by using OpenSSL.
I'm getting syntax errors attempting to compile my app. My environment is Microsoft Visual C++.
I downloaded and installed the OpenSSL pre-compiled binaries and added the following to the Include Directories.
   
   C:\Program Files\OpenSSL-Win64\includes

In my existing Socket.cpp file I added OpenSSL includes:
#include <stdio.h>
#include <string.h>
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <signal.h>


Severity Code                Description                                                                                   Project File                                                                                                         Line 
 
Error (active) E0077 this declaration has no storage class or type specifier DFDS C:\Program Files\OpenSSL-Win64\include\openssl\crypto.h 344
Error (active) E0065 expected a ';'                                          DFDS C:\Program Files\OpenSSL-Win64\include\openssl\crypto.h 344
OSSL_CRYPTO_ALLOC void *CRYPTO_malloc(size_t num, const char *file, int line);

The definition of OSSL_CRYPTO_ALLOC is in macros.h:
# ifndef OSSL_CRYPTO_ALLOC
#  if defined(__GNUC__)
#   define OSSL_CRYPTO_ALLOC __attribute__((malloc))
#  elif defined(_MSC_VER)
#   define OSSL_CRYPTO_ALLOC __declspec(restrict)
#  else
#   define OSSL_CRYPTO_ALLOC
#  endif
# endif

I figure it is using the _MSC_VER define, which is the __declspec one.

Any ideas what it is complaining about?

Don Payette
(cell) 479-216-6320


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux