Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move modulemap and remove Apple special imports #371

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/apple/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/* #undef HAVE_LIBSOCKET */

/* Whether we have linger */
/* #undef HAVE_LINGER */
#define HAVE_LINGER 1

/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
Expand Down
21 changes: 21 additions & 0 deletions include/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module SMB2 [system] [extern_c] {
module LibSMB2 {
header "apple/config.h"
header "smb2/smb2-errors.h"
header "smb2/smb2.h"
header "smb2/libsmb2.h"
header "smb2/libsmb2-dcerpc.h"
header "smb2/libsmb2-dcerpc-lsa.h"
header "smb2/libsmb2-dcerpc-srvsvc.h"
}

module Internal {
header "libsmb2-private.h"
}

explicit module Raw {
header "smb2/libsmb2-raw.h"
}

export SMB2
}
1 change: 1 addition & 0 deletions include/smb2/libsmb2-raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ struct smb2_pdu *smb2_cmd_set_info_async(struct smb2_context *smb2,
smb2_command_cb cb, void *cb_data);

struct smb2_pdu *smb2_cmd_set_info_reply_async(struct smb2_context *smb2,
struct smb2_set_info_request *req,
smb2_command_cb cb, void *cb_data);

/*
Expand Down
8 changes: 0 additions & 8 deletions include/smb2/libsmb2.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
#ifndef _LIBSMB2_H_
#define _LIBSMB2_H_

#ifdef __APPLE__ /* Some platforms doesn´t support stdint.h */
#include <stdint.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -1271,11 +1267,7 @@ int smb2_serve_port(struct smb2_server *server, const int max_connections, smb2_
* separation between dcerpc and smb2, so we need to include this header
* here to retain compatibility for apps that depend on those symbols.
*/
#ifdef __APPLE__
#include <libsmb2-dcerpc-srvsvc.h>
#else
#include <smb2/libsmb2-dcerpc-srvsvc.h>
#endif

#ifdef __cplusplus
}
Expand Down
10 changes: 7 additions & 3 deletions include/smb2/smb2.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
#ifndef _SMB2_H_
#define _SMB2_H_

#ifdef __APPLE__
#include <smb2-errors.h>
#else
#include <smb2/smb2-errors.h>

#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif

#ifdef HAVE_TIME_H
#include <time.h>
#endif

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion lib/libsmb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3124,7 +3124,7 @@ smb2_set_info_request_cb(struct smb2_server *server, struct smb2_context *smb2,
&err, SMB2_SET_INFO, SMB2_STATUS_NOT_IMPLEMENTED, NULL, cb_data);
}
else if (!ret) {
pdu = smb2_cmd_set_info_reply_async(smb2, NULL, cb_data);
pdu = smb2_cmd_set_info_reply_async(smb2, req, NULL, cb_data);
}
if (pdu != NULL) {
smb2_queue_pdu(smb2, pdu);
Expand Down
21 changes: 0 additions & 21 deletions module.modulemap

This file was deleted.

Loading